Helper class for generating signatures. More...
Static Public Member Functions | |
| 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 (final byte[][] data, final byte[] signature, String digestAlgorithm, final 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. | |
| static AlgorithmIdentifier | getSignatureAlgorithm (String hashAlgorithm, PrivateKey signingKey) throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidAlgorithmParameterException |
| Gets an AlgorithmIdentifier incorporating a given digest and encryption algorithm, and containing any necessary parameters for the signing key. | |
| static String | getSignatureAlgorithmName (String hashAlgorithm, PrivateKey signingKey) |
| Gets the JCA string name of a signature algorithm, to be used with a Signature object. | |
| static String | getSignatureAlgorithmName (String hashAlgorithm, PublicKey publicKey) |
| static String | getSignatureAlgorithmName (String hashAlgorithm, String keyAlgorithm) |
| Gets the JCA string name of a signature algorithm, to be used with a Signature object. | |
| static String | getSignatureAlgorithmOID (String hashAlgorithm, String keyAlgorithm) |
| Gets the OID of a signature algorithm, to be used with a Signature object. | |
Helper class for generating signatures.
| static AlgorithmIdentifier org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.getSignatureAlgorithm | ( | String | hashAlgorithm, | |
| PrivateKey | signingKey | |||
| ) | throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidAlgorithmParameterException [static] |
Gets an AlgorithmIdentifier incorporating a given digest and encryption algorithm, and containing any necessary parameters for the signing key.
| hashAlgorithm | the JCA standard name of the digest algorithm (e.g. "SHA1") | |
| signingKey | the private key that will be used to compute the signature |
| NoSuchAlgorithmException | if the algorithm identifier can't be formed | |
| InvalidParameterSpecException | ||
| InvalidAlgorithmParameterException |
| static String org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.getSignatureAlgorithmName | ( | String | hashAlgorithm, | |
| String | keyAlgorithm | |||
| ) | [static] |
Gets the JCA string name of a signature algorithm, to be used with a Signature object.
| hashAlgorithm | the JCA standard name of the digest algorithm (e.g. "SHA1"). | |
| keyAlgorithm | the key algorithm. |
| static String org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.getSignatureAlgorithmName | ( | String | hashAlgorithm, | |
| PrivateKey | signingKey | |||
| ) | [static] |
Gets the JCA string name of a signature algorithm, to be used with a Signature object.
| hashAlgorithm | the JCA standard name of the digest algorithm (e.g. "SHA1"). | |
| signingKey | the private key that will be used to compute the signature. |
| static String org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.getSignatureAlgorithmOID | ( | String | hashAlgorithm, | |
| String | keyAlgorithm | |||
| ) | [static] |
Gets the OID of a signature algorithm, to be used with a Signature object.
| hashAlgorithm | the JCA standard name of the digest algorithm (e.g. "SHA1"). | |
| keyAlgorithm | the key algorithm. |
| static byte [] org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.sign | ( | String | digestAlgorithm, | |
| byte | toBeSigneds[][], | |||
| PrivateKey | signingKey | |||
| ) | throws SignatureException, NoSuchAlgorithmException, InvalidKeyException [static] |
Sign concatenation of the toBeSigneds.
| digestAlgorithm | the digest algorithm. if null uses DEFAULT_DIGEST_ALGORITHM | |
| toBeSigneds | the content to be signed. | |
| signingKey | the signing key. |
| SignatureException | ||
| NoSuchAlgorithmException | ||
| InvalidKeyException |
Reimplemented in org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.
| static byte [] org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.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.
| 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 in org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.
| static boolean org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.verify | ( | byte[] | data, | |
| byte[] | signature, | |||
| String | digestAlgorithm, | |||
| PublicKey | verificationKey | |||
| ) | throws InvalidKeyException, SignatureException, NoSuchAlgorithmException [static] |
Verify a standalone signature.
| 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 in org.ccnx.ccn.impl.security.crypto.CCNSignatureHelper.
| static boolean org.ccnx.ccn.impl.security.crypto.util.SignatureHelper.verify | ( | final byte | data[][], | |
| final byte[] | signature, | |||
| String | digestAlgorithm, | |||
| final 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.
| 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 |
1.6.3