boolean verifySignatureFor(String algorithm, byte[] secretBytes, byte[] headerBytes, byte[] payloadBytes, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException {
        return MessageDigest.isEqual(createSignatureFor(algorithm, secretBytes, headerBytes, payloadBytes), signatureBytes);
    }
boolean verifySignatureFor ( String algorithm , byte [ ] secretBytes , byte [ ] headerBytes , byte [ ] payloadBytes , byte [ ] signatureBytes ) throws NoSuchAlgorithmException , InvalidKeyException { return MessageDigest . isEqual ( createSignatureFor ( algorithm , secretBytes , headerBytes , payloadBytes ) , signatureBytes ) ; }
Verify signature for JWT header and payload.

@param algorithm algorithm name.
@param secretBytes algorithm secret.
@param headerBytes JWT header.
@param payloadBytes JWT payload.
@param signatureBytes JWT signature.
@return true if signature is valid.
@throws NoSuchAlgorithmException if the algorithm is not supported.
@throws InvalidKeyException if the given key is inappropriate for initializing the specified algorithm.