Public Member Functions | |
Signature (String digestAlgorithm, byte[] witness, byte[] signature) | |
Build a Signature. | |
Signature (byte[] witness, byte[] signature) | |
Builds a Signature using the default digest algorithm. | |
Signature (byte[] signature) | |
Builds a Signature with the default digest algorithm and no witness. | |
Signature () | |
For use by decoders. | |
final byte[] | signature () |
Get the signature. | |
final byte[] | witness () |
Get the witness. | |
String | digestAlgorithm () |
Get the digest algorithm. | |
void | decode (XMLDecoder decoder) throws ContentDecodingException |
Decode this object as the top-level item in a new XML document, reading it from a network buffer. | |
void | encode (XMLEncoder encoder) throws ContentEncodingException |
Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement. | |
long | getElementLabel () |
Allow the encoder/decoder to retrieve the top-level element name programmatically. | |
boolean | validate () |
Make sure all of the necessary fields are filled in prior to attempting to encode. | |
Signature | clone () |
Implement Cloneable. | |
int | compareTo (Signature o) |
Implement Comparable. | |
int | hashCode () |
boolean | equals (Object obj) |
byte[] | computeProxy (byte[] nodeContent, boolean isDigest) throws CertificateEncodingException |
Compute the content proxy for a given node. | |
Package Attributes | |
byte[] | _witness |
byte[] | _signature |
String | _digestAlgorithm |
A Signature contains three components: the digestAlgorithm used to generate the digest, the bits of the signature itself, and an optional "witness" which is used in the verification of aggregated signatures -- signatures that are generated over multiple objects at once. Each object in such a signature group has its own witness, which is necessary to verify that object with respect to that signature. For example, if a set of content objects is digested into a Merkle hash tree, the signature bits for each member of set would contain the same public key signature on the root of the hash tree, and the witness would contain a representation of the path through the Merkle tree that one needs to traverse to verify that individual block.
For an explanation of why we separate the digest algorithm in the signature (rather than no algorithm at all, or a composite signature algorithm), see ccnx.xsd.
org.ccnx.ccn.protocol.Signature.Signature | ( | String | digestAlgorithm, | |
byte[] | witness, | |||
byte[] | signature | |||
) |
Build a Signature.
digestAlgorithm | if null, will use default | |
witness | can be null | |
signature |
org.ccnx.ccn.protocol.Signature.Signature | ( | byte[] | witness, | |
byte[] | signature | |||
) |
org.ccnx.ccn.protocol.Signature.Signature | ( | byte[] | signature | ) |
final byte [] org.ccnx.ccn.protocol.Signature.signature | ( | ) |
Get the signature.
final byte [] org.ccnx.ccn.protocol.Signature.witness | ( | ) |
Get the witness.
String org.ccnx.ccn.protocol.Signature.digestAlgorithm | ( | ) |
Get the digest algorithm.
void org.ccnx.ccn.protocol.Signature.decode | ( | XMLDecoder | decoder | ) | throws ContentDecodingException [virtual] |
Decode this object as the top-level item in a new XML document, reading it from a network buffer.
Reads document start and end. Assumes default encoding.
buf | input stream to read from |
ContentDecodingException | if there is an error decoding the content Decode this object as the top-level item in a new XML document, reading it from a network buffer. Reads document start and end. |
buf | input stream to read from | |
codec | the codec to use; must be recognized by XMLCodecFactory |
ContentDecodingException | if there is an error decoding the content |
decoder | the decoder being used; encapsulates state including the codec being used as well as the input source and current offset |
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
void org.ccnx.ccn.protocol.Signature.encode | ( | XMLEncoder | encoder | ) | throws ContentEncodingException [virtual] |
Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement.
Writes just the object itself, higher-level processes have handled start and end document if need be. Allows object to be written using the same code whether it is a top-level element written alone, or nested inside another element.
encoder | the encoder being used; encapsulates state including the codec being used as well as the output destination and current offset |
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
long org.ccnx.ccn.protocol.Signature.getElementLabel | ( | ) | [virtual] |
Allow the encoder/decoder to retrieve the top-level element name programmatically.
This allows subclasses to rename elements without changing their encoder/decoders.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
boolean org.ccnx.ccn.protocol.Signature.validate | ( | ) | [virtual] |
Make sure all of the necessary fields are filled in prior to attempting to encode.
All implementations of encode(XMLEncoder) should call this for their classes prior to encoding.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
byte [] org.ccnx.ccn.protocol.Signature.computeProxy | ( | byte[] | nodeContent, | |
boolean | isDigest | |||
) | throws CertificateEncodingException |
Compute the content proxy for a given node.
This should likely move somewhere else
nodeContent | the content stored at this node | |
isDigest | is the content already digested |
CertificateEncodingException | if we cannot decode the witness |