PublicKey { public abstract boolean verifySignature(byte[] signature, byte[] message); protected  PublicKey(String encodedKey, String comment); abstract String getType(); abstract boolean verifySignature(byte[] signature, byte[] message); Fingerprint getFingerprint(); @Override String toString(); static PublicKey valueOf(String key);  }
@Test public void testRsaVerify() throws IOException { byte[] signature = generateRsaSignature(message); assertTrue(rsaPublicKey.verifySignature(signature, message)); }
@Test public void testDsaVerify() throws IOException { byte[] signature = generateDsaSignature(message); assertTrue(dsaPublicKey.verifySignature(signature, message)); }
@Test public void testRsaVerifyFromAgent() throws IOException { byte[] signature = loadBinaryResource("signature.rsa"); assertTrue(rsaPublicKey.verifySignature(signature, message)); }
@Test public void testDsaVerifyFromAgent() throws IOException { byte[] signature = loadBinaryResource("signature.dsa"); assertTrue(dsaPublicKey.verifySignature(signature, message)); }
@Test public void testDsaVerifyFromAgentWithEnvelope() throws IOException { byte[] signature = loadBinaryResource("signature-envelope.dsa"); assertTrue(dsaPublicKey.verifySignature(signature, message)); }