org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper Class Reference

Helper class for generating signatures, supporting CCN-specific operations. More...

Inheritance diagram for org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper:

org.ccnx.ccn.impl.security.crypto.util.SignatureHelper

List of all members.

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 auxiliary 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.


Detailed Description

Helper class for generating signatures, supporting CCN-specific operations.

Member Function Documentation

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.

Parameters:
digestAlgorithm the digest algorithm to use for the signature
toBeSigned the object to encode and sign
signingKey the private key to sign with
Returns:
the signature
Exceptions:
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[]  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 auxiliary data.

Parameters:
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
Returns:
the signature
Exceptions:
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.

Parameters:
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
Returns:
true if valid, false otherwise
Exceptions:
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  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.

Parameters:
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
Returns:
true if valid, false otherwise
Exceptions:
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,
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.

Parameters:
digestAlgorithm the digest algorithm. if null uses DEFAULT_DIGEST_ALGORITHM
toBeSigned the array of bytes to be signed.
signingKey the signing key.
Returns:
the signature.
Exceptions:
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  toBeSigneds[][],
PrivateKey  signingKey 
) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException [static]

Sign concatenation of the toBeSigneds.

Overrides SignatureHelper to get correct default digest.

Parameters:
digestAlgorithm the digest algorithm. if null uses DEFAULT_DIGEST_ALGORITHM
toBeSigneds the content to be signed.
signingKey the signing key.
Returns:
the signature.
Exceptions:
SignatureException 
NoSuchAlgorithmException 
InvalidKeyException 

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.

Parameters:
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.
Returns:
the correctness of the signature as a boolean.
Exceptions:
SignatureException 
NoSuchAlgorithmException 
InvalidKeyException 

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.

Parameters:
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
Returns:
true if signature valid, false otherwise
Exceptions:
InvalidKeyException 
SignatureException 
NoSuchAlgorithmException 

Reimplemented from org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:44:57 2012 for Content-Centric Networking in Java by  doxygen 1.5.6