|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The VerifiableBlock
interface should be implemented
by all objects that need to be self-verifiable. In
order to be self-verifiable, an object must maintain a field to
record the fhash
, the secure hash that lies at the
root of the verification tree constructed from the
erasure-encoded fragments produced by the archival layer. A
self-verifiable object must also provide methods for computing
and verifying guids and verification hashes. In computing a
guid, an object should reference all information (including its
fhash
). In computing a vhash, however, an object
should not reference any guids that are created by the archive.
If the archive has not yet computed the fragments for an object,
the object will lack an fhash
and thus will be
unable to compute or verify its own guid. If such a request is
made, a BlockNotGuidVerifiableException
is thrown.
Method Summary | |
---|---|
SecureHash |
computeGuid()
Compute and return the guid of the object. |
SecureHash |
computeVhash()
Compute and return the verification hash of the object. |
SecureHash |
getFhash()
Return the secure hash at the root of the verification tree constructed from the erasure-encoded fragments of a block. |
void |
setFhash(SecureHash fhash)
Record the secure hash at the root of the verification tree constructed from the erasure-encoded fragments of a block. |
void |
toGuidBytes(byte[] data,
int[] offset)
Serialize the object in a form suitable for computing the block guid of the object. |
void |
toVhashBytes(byte[] data,
int[] offset)
Serialize the object in a form suitable for computing the verification hash of the object. |
boolean |
verifyGuid(SecureHash bguid)
Verify the contents of the object against its given guid. |
boolean |
verifyVhash(SecureHash vhash)
Verify the contents of the object against its given verification hash. |
Methods inherited from interface ostore.util.QuickSerializable |
---|
serialize |
Method Detail |
public SecureHash getFhash()
public void setFhash(SecureHash fhash)
fhash
- the secure hash at the root of the verification treepublic SecureHash computeVhash()
public void toVhashBytes(byte[] data, int[] offset)
data
- See ostore.util.QuickSerializable.to_bytes
offset
- See ostore.util.QuickSerializable.to_bytes
public boolean verifyVhash(SecureHash vhash)
vhash
- the vhash against which to verify the object
true
iff the hash of the object matches
vhash
; false
otherwisepublic SecureHash computeGuid() throws BlockNotGuidVerifiableException
ostore.util.BlockNotGuidVerifiable
- if the precondition is
not satisfied.
BlockNotGuidVerifiableException
setFhash(ostore.util.SecureHash)
public void toGuidBytes(byte[] data, int[] offset) throws BlockNotGuidVerifiableException
data
- See ostore.util.QuickSerializable.to_bytes
offset
- See ostore.util.QuickSerializable.to_bytes
ostore.util.BlockNotGuidVerifiable
- if the precondition is
not satisfied.
BlockNotGuidVerifiableException
public boolean verifyGuid(SecureHash bguid) throws BlockNotGuidVerifiableException
bguid
- the block guid against which to verify the object
true
iff the guid of the object matches
bguid
; false
otherwise
ostore.util.BlockNotGuidVerifiable
- if the precondition is
not satisfied.
BlockNotGuidVerifiableException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |