Public Member Functions | |
MerklePath (int leafNodeIndex, DEROctetString[] path) | |
Create a MerklePath for a given leaf. | |
MerklePath (byte[] derEncodedPath) throws CertificateEncodingException | |
Decode a DER encoded MerklePath. | |
byte[] | root (byte[] nodeContent, boolean isDigest) |
Take the content block for which this is the MerklePath, and compute the root digest for verification. | |
DEROctetString | entry (int i) |
Get an in the path, where i is the index into the path array. | |
int | leafNodeIndex () |
Return the leaf node this path is for. | |
int | pathLength () |
byte[] | derEncodedPath () |
DER-encode the path. | |
int | hashCode () |
boolean | equals (Object obj) |
Static Public Member Functions | |
static boolean | isMerklePath (DigestInfo info) |
Determine whether a given DigestInfo contains a MerklePath. | |
Protected Member Functions | |
byte[] | computeParent (int node, int length, byte[] pathDigest) |
Compute the parent digest of the current node. | |
Package Attributes | |
int | _leafNodeIndex |
DEROctetString[] | _path = null |
org.ccnx.ccn.impl.security.crypto.MerklePath.MerklePath | ( | int | leafNodeIndex, | |
DEROctetString[] | path | |||
) |
Create a MerklePath for a given leaf.
leafNodeIndex | the leaf index | |
path | the node digests necessary to verify that leaf |
org.ccnx.ccn.impl.security.crypto.MerklePath.MerklePath | ( | byte[] | derEncodedPath | ) | throws CertificateEncodingException |
Decode a DER encoded MerklePath.
derEncodedPath | the encoded path |
CertificateEncodingException | if there is a decoding error |
byte [] org.ccnx.ccn.impl.security.crypto.MerklePath.computeParent | ( | int | node, | |
int | length, | |||
byte[] | pathDigest | |||
) | [protected] |
Compute the parent digest of the current node.
node | the current node | |
length | the length of the path at this point | |
pathDigest | the previously computed digest along this path |
byte [] org.ccnx.ccn.impl.security.crypto.MerklePath.root | ( | byte[] | nodeContent, | |
boolean | isDigest | |||
) |
Take the content block for which this is the MerklePath, and compute the root digest for verification.
The caller then needs to check whether it matches the root, and the root is authentic (signed by a trusted key).
nodeContent | either the content of the block or its digest. If a subclass of MerkleTree overrides computeBlockDigest, a caller must hand in the digest, as this uses the MerkleTree default. | |
isDigest | was this node already digested, or do we need to digest it |
DEROctetString org.ccnx.ccn.impl.security.crypto.MerklePath.entry | ( | int | i | ) |
Get an in the path, where i is the index into the path array.
i | the entry we want |
int org.ccnx.ccn.impl.security.crypto.MerklePath.leafNodeIndex | ( | ) |
Return the leaf node this path is for.
byte [] org.ccnx.ccn.impl.security.crypto.MerklePath.derEncodedPath | ( | ) |
DER-encode the path.
Embed it in a DigestInfo with the appropriate algorithm identifier.
Sequence of OCTET STRING
Sequence of INTEGER, SEQUENCE OF OCTET STRING
static boolean org.ccnx.ccn.impl.security.crypto.MerklePath.isMerklePath | ( | DigestInfo | info | ) | [static] |
Determine whether a given DigestInfo contains a MerklePath.
info | the DigestInfo |