Lines Matching refs:signature

66  * Note that the underlying PKCS#11 token may support complete signature
68 * implement the signature algorithm without hashing (e.g. CKM_DSA, CKM_PKCS),
90 // digest algorithm OID, if we encode RSA signature ourselves
220 throw new ProviderException("Unknown signature: " + algorithm);
271 byte[] signature;
273 signature = new byte[40];
275 signature = new byte[(p11Key.length() + 7) >> 3];
278 token.p11.C_VerifyFinal(session.id(), signature);
286 token.p11.C_Verify(session.id(), digest, signature);
289 // will fail since the signature is incorrect
342 throw new ProviderException("Unknown signature algo: " + algorithm);
346 ("Key is too short for this signature algorithm");
506 byte[] signature;
509 signature = token.p11.C_SignFinal(session.id(), len);
532 signature = token.p11.C_Sign(session.id(), digest);
538 signature = token.p11.C_Sign(session.id(), data);
542 return dsaToASN1(signature);
544 return signature;
555 protected boolean engineVerify(byte[] signature) throws SignatureException {
559 signature = asn1ToDSA(signature);
561 signature = asn1ToECDSA(signature);
564 token.p11.C_VerifyFinal(session.id(), signature);
587 token.p11.C_Verify(session.id(), digest, signature);
593 token.p11.C_Verify(session.id(), data, signature);
639 // private static byte[] decodeSignature(byte[] signature) throws IOException {
640 // return RSASignature.decodeSignature(digestOID, signature);
648 private static byte[] dsaToASN1(byte[] signature) {
649 int n = signature.length >> 1;
650 BigInteger r = new BigInteger(1, P11Util.subarray(signature, 0, n));
651 BigInteger s = new BigInteger(1, P11Util.subarray(signature, n, n));
664 private static byte[] asn1ToDSA(byte[] signature) throws SignatureException {
666 DerInputStream in = new DerInputStream(signature);
679 throw new SignatureException("invalid encoding for signature", e);
683 private byte[] asn1ToECDSA(byte[] signature) throws SignatureException {
685 DerInputStream in = new DerInputStream(signature);
699 throw new SignatureException("invalid encoding for signature", e);