@Test public void testVerifySignatureFailWhenSignatureDoesntMatch() { NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier("someApiSecret"); boolean actual = verifier.verifySignature( "{}", "0", "notMatchingForSure"); assertFalse(actual); }
public boolean verifySignature(String body, String timestamp, String signature) { return signedPayloadValidator.validateSignedPayload( emptyIfNull(body) + emptyIfNull(timestamp), signature); }
NotificationRequestSignatureVerifier { public boolean verifySignature(String body, String timestamp, String signature) { return signedPayloadValidator.validateSignedPayload( emptyIfNull(body) + emptyIfNull(timestamp), signature); } }
NotificationRequestSignatureVerifier { public boolean verifySignature(String body, String timestamp, String signature) { return signedPayloadValidator.validateSignedPayload( emptyIfNull(body) + emptyIfNull(timestamp), signature); } NotificationRequestSignatureVerifier(String secretKey);  NotificationRequestSignatureVerifier(String secretKey, SignatureAlgorithm signatureAlgorithm); }
NotificationRequestSignatureVerifier { public boolean verifySignature(String body, String timestamp, String signature) { return signedPayloadValidator.validateSignedPayload( emptyIfNull(body) + emptyIfNull(timestamp), signature); } NotificationRequestSignatureVerifier(String secretKey);  NotificationRequestSignatureVerifier(String secretKey, SignatureAlgorithm signatureAlgorithm); boolean verifySignature(String body, String timestamp, String signature); boolean verifySignature(String body, String timestamp, String signature, long secondsValidFor); }
NotificationRequestSignatureVerifier { public boolean verifySignature(String body, String timestamp, String signature) { return signedPayloadValidator.validateSignedPayload( emptyIfNull(body) + emptyIfNull(timestamp), signature); } NotificationRequestSignatureVerifier(String secretKey);  NotificationRequestSignatureVerifier(String secretKey, SignatureAlgorithm signatureAlgorithm); boolean verifySignature(String body, String timestamp, String signature); boolean verifySignature(String body, String timestamp, String signature, long secondsValidFor);  }