Public Member Functions | |
CCNDigestHelper () | |
Make a CCNDigestHelper using the default digest algorithm (DEFAULT_DIGEST_ALGORITHM). | |
CCNDigestHelper (String digestAlgorithm) throws NoSuchAlgorithmException | |
Make a CCNDigestHelper that uses a specified algorithm. | |
String | getDefaultDigest () |
This method is non-static so subclasses can override it. | |
Static Public Member Functions | |
static byte[] | digestLeaf (String digestAlgorithm, XMLEncodable[] toBeSigneds, byte[][] additionalToBeSigneds) throws ContentEncodingException, NoSuchAlgorithmException |
Same digest preparation algorithm as ContentObject. | |
static byte[] | digest (byte[] content) |
Static digest helper. | |
static byte[] | digest (String digestAlgorithm, byte[] content) throws NoSuchAlgorithmException |
Static digest helper. | |
static byte[] | digest (byte[] content, int offset, int length) |
Static digest helper. | |
static byte[] | digest (String digestAlgorithm, byte[] content, int offset, int length) throws NoSuchAlgorithmException |
Static digest helper. | |
static byte[] | digest (byte[] content1, byte[] content2) |
Static digest helper; returns the digest of the concatenation of two byte arrays. | |
static byte[] | digest (String digestAlgorithm, byte[] content1, byte[] content2) throws NoSuchAlgorithmException |
Static digest helper; returns the digest of the concatenation of two byte arrays. | |
static byte[] | digest (byte contents[][]) |
Static digest helper; returns the digest of the concatenation of any number of component byte arrays. | |
static byte[] | digest (String digestAlgorithm, byte contents[][]) throws NoSuchAlgorithmException |
Static digest helper; returns the digest of the concatenation of any number of component byte arrays. | |
static byte[] | digest (String digestAlgorithm, InputStream input) throws NoSuchAlgorithmException, IOException |
static byte[] | digest (InputStream input) throws IOException |
static byte[] | encodedDigest (String digestAlgorithm, byte[] content) throws CertificateEncodingException, NoSuchAlgorithmException |
Digests some data and wraps it in an encoded PKCS#1 DigestInfo, which contains a specification of the digestAlgorithm (as an Object Identifier, or OID wrapped in an AlgorithmIdentifier, which for a digest algorithm typically has null parameters), and the digest itself, all encoded in DER. | |
static byte[] | encodedDigest (byte[] content) throws CertificateEncodingException |
Digests some data and wraps it in an encoded PKCS#1 DigestInfo, which contains a specification of the digestAlgorithm (as an Object Identifier, or OID wrapped in an AlgorithmIdentifier, which for a digest algorithm typically has null parameters), and the digest itself, all encoded in DER. | |
Static Public Attributes | |
static String | DEFAULT_DIGEST_ALGORITHM = "SHA-256" |
Current default algorithm is SHA-256. | |
static int | DEFAULT_DIGEST_LENGTH = 32 |
org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.CCNDigestHelper | ( | String | digestAlgorithm | ) | throws NoSuchAlgorithmException |
Make a CCNDigestHelper that uses a specified algorithm.
digestAlgorithm | algorithm to use |
NoSuchAlgorithmException | if digestAlgorithm is unknown to any of our cryptography Providers |
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digestLeaf | ( | String | digestAlgorithm, | |
XMLEncodable[] | toBeSigneds, | |||
byteadditionalToBeSigneds | [][] | |||
) | throws ContentEncodingException, NoSuchAlgorithmException [static] |
Same digest preparation algorithm as ContentObject.
ContentEncodingException | ||
NoSuchAlgorithmException |
String org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.getDefaultDigest | ( | ) |
This method is non-static so subclasses can override it.
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | byte[] | content | ) | [static] |
Static digest helper.
content | content to digest |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | String | digestAlgorithm, | |
byte[] | content | |||
) | throws NoSuchAlgorithmException [static] |
Static digest helper.
digestAlgorithm | digest algorithm to use | |
content | content to digest |
NoSuchAlgorithmException | if the algorithm is unknown to any of our providers |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | byte[] | content, | |
int | offset, | |||
int | length | |||
) | [static] |
Static digest helper.
content | content to digest | |
offset | offset into content at which to start digesting, in bytes | |
length | number of bytes of content to digest |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | String | digestAlgorithm, | |
byte[] | content, | |||
int | offset, | |||
int | length | |||
) | throws NoSuchAlgorithmException [static] |
Static digest helper.
digestAlgorithm | digest algorithm to use | |
content | content to digest | |
offset | offset into content at which to start digesting, in bytes | |
length | number of bytes of content to digest |
NoSuchAlgorithmException | if the algorithm is unknown to any of our providers |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | byte[] | content1, | |
byte[] | content2 | |||
) | [static] |
Static digest helper; returns the digest of the concatenation of two byte arrays.
If either is null, simply includes the non-null array in the digest.
content1 | first content array to digest | |
content2 | second content array to digest |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | String | digestAlgorithm, | |
byte[] | content1, | |||
byte[] | content2 | |||
) | throws NoSuchAlgorithmException [static] |
Static digest helper; returns the digest of the concatenation of two byte arrays.
If either is null, simply includes the non-null array in the digest.
digestAlgorithm | digest algorithm to use | |
content1 | first content array to digest | |
content2 | second content array to digest |
NoSuchAlgorithmException | if the algorithm is unknown to any of our providers |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | byte | contents[][] | ) | [static] |
Static digest helper; returns the digest of the concatenation of any number of component byte arrays.
Null arrays are skipped
contents | the arrays of content to digest |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.digest | ( | String | digestAlgorithm, | |
byte | contents[][] | |||
) | throws NoSuchAlgorithmException [static] |
Static digest helper; returns the digest of the concatenation of any number of component byte arrays.
Null arrays are skipped
digestAlgorithm | digest algorithm to use | |
contents | the arrays of content to digest |
NoSuchAlgorithmException | if the algorithm is unknown to any of our providers |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.encodedDigest | ( | String | digestAlgorithm, | |
byte[] | content | |||
) | throws CertificateEncodingException, NoSuchAlgorithmException [static] |
Digests some data and wraps it in an encoded PKCS#1 DigestInfo, which contains a specification of the digestAlgorithm (as an Object Identifier, or OID wrapped in an AlgorithmIdentifier, which for a digest algorithm typically has null parameters), and the digest itself, all encoded in DER.
digestAlgorithm | the algorithm to use to digest (as a Java String algorithm name) | |
content | the content to digest |
CertificateEncodingException | if there is an error in encoding | |
NoSuchAlgorithmException | if none of our providers recognize digestAlgorithm, or know its OID |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.encodedDigest | ( | byte[] | content | ) | throws CertificateEncodingException [static] |
Digests some data and wraps it in an encoded PKCS#1 DigestInfo, which contains a specification of the digestAlgorithm (as an Object Identifier, or OID wrapped in an AlgorithmIdentifier, which for a digest algorithm typically has null parameters), and the digest itself, all encoded in DER.
This digests content with the DEFAULT_DIGEST_ALGORITHM.
content | the content to digest |
CertificateEncodingException | if there is an error in encoding |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.
String org.ccnx.ccn.impl.security.crypto.CCNDigestHelper.DEFAULT_DIGEST_ALGORITHM = "SHA-256" [static] |
Current default algorithm is SHA-256.
We expect it to move to SHA3 when that is standardized. We're doing our best to support variable algorithms in all but core network components (digest components in ContentNames, publisher IDs), whose digest algorithm is fixed for a given protocol version.
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.DigestHelper.