public PGPContentVerifier build(final PGPPublicKey publicKey) throws PGPException { final Signer signer = BcImplProvider.createSigner(keyAlgorithm, hashAlgorithm); signer.init(false, keyConverter.getPublicKey(publicKey)); return new PGPContentVerifier() { public int getHashAlgorithm() { return hashAlgorithm; } public int getKeyAlgorithm() { return keyAlgorithm; } public long getKeyID() { return publicKey.getKeyID(); } public boolean verify(byte[] expected) { return signer.verifySignature(expected); } public OutputStream getOutputStream() { return new SignerOutputStream(signer); } }; }