public static boolean verify ( Signature signatureAlgorithm , PublicKey publicKey , byte [ ] signatureBytes , byte [ ] contentBytes ) throws InvalidKeyException , SignatureException { signatureAlgorithm . initVerify ( publicKey ) ; signatureAlgorithm . update ( contentBytes ) ; // SignatureException may be thrown if we are tring the wrong key. try { return signatureAlgorithm . verify ( signatureBytes ) ; } catch ( SignatureException e ) { return false ; } }
Verifies the signature of signed content based on a public key .