public ContentVerifier get(AlgorithmIdentifier algorithm) throws OperatorCreationException { try { Signature sig = helper.createSignature(algorithm); sig.initVerify(certificate.getPublicKey()); stream = new SignatureOutputStream(sig); } catch (GeneralSecurityException e) { throw new OperatorCreationException("exception on setup: " + e, e); } Signature rawSig = createRawSig(algorithm, certificate.getPublicKey()); if (rawSig != null) { return new RawSigVerifier(algorithm, stream, rawSig); } else { return new SigVerifier(algorithm, stream); } } };
public boolean verify(byte[] digest, byte[] expected) { try { rawSignature.update(digest); return rawSignature.verify(expected); } catch (SignatureException e) { throw new RuntimeOperatorException("exception obtaining raw signature: " + e.getMessage(), e); } finally { // we need to do this as in some PKCS11 implementations the session associated with the init of the // standard signature will not be freed if verify is not called on it. try { stream.verify(expected); } catch (Exception e) { // ignore } } } }
stream = new SignatureOutputStream(sig);
stream = new SignatureOutputStream(sig);
public boolean verify(byte[] digest, byte[] expected) { try { rawSignature.update(digest); return rawSignature.verify(expected); } catch (SignatureException e) { throw new RuntimeOperatorException("exception obtaining raw signature: " + e.getMessage(), e); } finally { // we need to do this as in some PKCS11 implementations the session associated with the init of the // standard signature will not be freed if verify is not called on it. try { stream.verify(expected); } catch (Exception e) { // ignore } } } }
public ContentVerifier get(AlgorithmIdentifier algorithm) throws OperatorCreationException { try { Signature sig = helper.createSignature(algorithm); sig.initVerify(certificate.getPublicKey()); stream = new SignatureOutputStream(sig); } catch (GeneralSecurityException e) { throw new OperatorCreationException("exception on setup: " + e, e); } Signature rawSig = createRawSig(algorithm, certificate.getPublicKey()); if (rawSig != null) { return new RawSigVerifier(algorithm, stream, rawSig); } else { return new SigVerifier(algorithm, stream); } } };
private SignatureOutputStream createSignatureStream(AlgorithmIdentifier algorithm, PublicKey publicKey) throws OperatorCreationException { try { Signature sig = helper.createSignature(algorithm); sig.initVerify(publicKey); return new SignatureOutputStream(sig); } catch (GeneralSecurityException e) { throw new OperatorCreationException("exception on setup: " + e, e); } }
private SignatureOutputStream createSignatureStream(AlgorithmIdentifier algorithm, PublicKey publicKey) throws OperatorCreationException { try { Signature sig = helper.createSignature(algorithm); sig.initVerify(publicKey); return new SignatureOutputStream(sig); } catch (GeneralSecurityException e) { throw new OperatorCreationException("exception on setup: " + e, e); } }
public boolean verify(byte[] expected) { try { return stream.verify(expected); } catch (SignatureException e) { throw new RuntimeOperatorException("exception obtaining signature: " + e.getMessage(), e); } } }
public boolean verify(byte[] expected) { try { return stream.verify(expected); } catch (SignatureException e) { throw new RuntimeOperatorException("exception obtaining signature: " + e.getMessage(), e); } } }