Helper class for generating signatures, supporting CCN-specific operations. More...
Static Public Member Functions | |
static byte[] | sign (String digestAlgorithm, XMLEncodable toBeSigned, PrivateKey signingKey) throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException |
Helper method that encodes and then signs an XMLEncodable object. | |
static byte[] | sign (String digestAlgorithm, XMLEncodable[] toBeSigneds, byte additionalToBeSigneds[][], PrivateKey signingKey) throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException |
Helper method that encodes, concatenates and then signs a set of XMLEncodable objects and auxilliary data. | |
static boolean | verify (XMLEncodable xmlData, byte[] signature, String digestAlgorithm, PublicKey verificationKey) throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException |
Helper method that encodes and then verifies a signature on an XMLEncodable object. | |
static boolean | verify (XMLEncodable[] xmlData, byte auxiliaryData[][], byte[] signature, String digestAlgorithm, PublicKey verificationKey) throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException |
Helper method that encodes, concatenates and then verifies a signature on a set of XMLEncodable objects and auxiliary data. | |
static byte[] | sign (String digestAlgorithm, byte[] toBeSigned, PrivateKey signingKey) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException |
Signs an array of bytes with a private signing key and specified digest algorithm. | |
static byte[] | sign (String digestAlgorithm, byte toBeSigneds[][], PrivateKey signingKey) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException |
Sign concatenation of the toBeSigneds. | |
static boolean | verify (byte data[][], byte[] signature, String digestAlgorithm, PublicKey verificationKey) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException |
Verifies the signature on the concatenation of a set of individual data items, given the verification key and digest algorithm. | |
static boolean | verify (byte[] data, byte[] signature, String digestAlgorithm, PublicKey verificationKey) throws InvalidKeyException, SignatureException, NoSuchAlgorithmException |
Verify a standalone signature. |
Helper class for generating signatures, supporting CCN-specific operations.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.sign | ( | String | digestAlgorithm, | |
byte | toBeSigneds[][], | |||
PrivateKey | signingKey | |||
) | throws SignatureException, NoSuchAlgorithmException, InvalidKeyException [static] |
Sign concatenation of the toBeSigneds.
Overrides SignatureHelper to get correct default digest.
digestAlgorithm | the digest algorithm. if null uses DEFAULT_DIGEST_ALGORITHM | |
toBeSigneds | the content to be signed. | |
signingKey | the signing key. |
SignatureException | ||
NoSuchAlgorithmException | ||
InvalidKeyException |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.sign | ( | String | digestAlgorithm, | |
byte[] | toBeSigned, | |||
PrivateKey | signingKey | |||
) | throws SignatureException, NoSuchAlgorithmException, InvalidKeyException [static] |
Signs an array of bytes with a private signing key and specified digest algorithm.
Overrides SignatureHelper to get correct default digest.
digestAlgorithm | the digest algorithm. if null uses DEFAULT_DIGEST_ALGORITHM | |
toBeSigned | the array of bytes to be signed. | |
signingKey | the signing key. |
SignatureException | ||
NoSuchAlgorithmException | ||
InvalidKeyException |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.
static byte [] org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.sign | ( | String | digestAlgorithm, | |
XMLEncodable[] | toBeSigneds, | |||
byte | additionalToBeSigneds[][], | |||
PrivateKey | signingKey | |||
) | throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException [static] |
Helper method that encodes, concatenates and then signs a set of XMLEncodable objects and auxilliary data.
digestAlgorithm | the digest algorithm to use for the signature | |
toBeSigneds | the objects to encode, concatenate and sign | |
additionalToBeSigneds | additional data to be concatenated with the encoded toBeSigneds prior to signing | |
signingKey | the private key to sign with |
SignatureException | if the content is null, or there is an error generating the signature | |
NoSuchAlgorithmException | if the digestAlgorithm is not recognized | |
InvalidKeyException | if the signingKey is not valid | |
ContentEncodingException | if the object cannot be encoded |
static byte [] org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.sign | ( | String | digestAlgorithm, | |
XMLEncodable | toBeSigned, | |||
PrivateKey | signingKey | |||
) | throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException [static] |
Helper method that encodes and then signs an XMLEncodable object.
digestAlgorithm | the digest algorithm to use for the signature | |
toBeSigned | the object to encode and sign | |
signingKey | the private key to sign with |
SignatureException | if the content is null, or there is an error generating the signature | |
NoSuchAlgorithmException | if the digestAlgorithm is not recognized | |
InvalidKeyException | if the signingKey is not valid | |
ContentEncodingException | if the object cannot be encoded |
static boolean org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.verify | ( | byte[] | data, | |
byte[] | signature, | |||
String | digestAlgorithm, | |||
PublicKey | verificationKey | |||
) | throws InvalidKeyException, SignatureException, NoSuchAlgorithmException [static] |
Verify a standalone signature.
Overrides SignatureHelper to get correct default digest.
data | the data whose signature we want to verify | |
signature | the signature itself | |
digestAlgorithm | the digest algorithm used to generate the signature. if null uses DEFAULT_DIGEST_ALGORITHM | |
verificationKey | the public key to verify the signature with |
InvalidKeyException | ||
SignatureException | ||
NoSuchAlgorithmException |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.
static boolean org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.verify | ( | byte | data[][], | |
byte[] | signature, | |||
String | digestAlgorithm, | |||
PublicKey | verificationKey | |||
) | throws SignatureException, NoSuchAlgorithmException, InvalidKeyException [static] |
Verifies the signature on the concatenation of a set of individual data items, given the verification key and digest algorithm.
Overrides SignatureHelper to get correct default digest.
data | the data; which are expected to have been concatenated before signing. Any null arrays are skipped. | |
signature | the signature. | |
digestAlgorithm | the digest algorithm. if null uses DEFAULT_DIGEST_ALGORITHM | |
verificationKey | the public verification key. |
SignatureException | ||
NoSuchAlgorithmException | ||
InvalidKeyException |
Reimplemented from org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.
static boolean org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.verify | ( | XMLEncodable[] | xmlData, | |
byte | auxiliaryData[][], | |||
byte[] | signature, | |||
String | digestAlgorithm, | |||
PublicKey | verificationKey | |||
) | throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException [static] |
Helper method that encodes, concatenates and then verifies a signature on a set of XMLEncodable objects and auxiliary data.
xmlData | the objects to encode and verify | |
auxiliaryData | ||
signature | the signature | |
digestAlgorithm | the digest algorithm used for the signature | |
verificationKey | the public key to verify with |
SignatureException | if the content is null, or there is an error generating the signature | |
NoSuchAlgorithmException | if the digestAlgorithm is not recognized | |
InvalidKeyException | if the signingKey is not valid | |
ContentEncodingException | if the object cannot be encoded |
static boolean org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.verify | ( | XMLEncodable | xmlData, | |
byte[] | signature, | |||
String | digestAlgorithm, | |||
PublicKey | verificationKey | |||
) | throws SignatureException, InvalidKeyException, NoSuchAlgorithmException, ContentEncodingException [static] |
Helper method that encodes and then verifies a signature on an XMLEncodable object.
xmlData | the object to encode and verify | |
signature | the signature | |
digestAlgorithm | the digest algorithm used for the signature | |
verificationKey | the public key to verify with |
SignatureException | if the content is null, or there is an error generating the signature | |
NoSuchAlgorithmException | if the digestAlgorithm is not recognized | |
InvalidKeyException | if the signingKey is not valid | |
ContentEncodingException | if the object cannot be encoded |