Package com.adyen.util
Class HMACValidator
- java.lang.Object
-
- com.adyen.util.HMACValidator
-
public class HMACValidator extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_SEPARATORstatic StringHMAC_SHA256_ALGORITHM
-
Constructor Summary
Constructors Constructor Description HMACValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcalculateHMAC(NotificationRequestItem notificationRequestItem, String key)StringcalculateHMAC(String data, String key)StringgetDataToSign(NotificationRequestItem notificationRequestItem)booleanvalidateHMAC(NotificationRequestItem notificationRequestItem, String key)booleanvalidateHMAC(String hmacSignature, String hmacKey, String payload)
-
-
-
Field Detail
-
HMAC_SHA256_ALGORITHM
public static final String HMAC_SHA256_ALGORITHM
- See Also:
- Constant Field Values
-
DATA_SEPARATOR
public static final String DATA_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
calculateHMAC
public String calculateHMAC(String data, String key) throws IllegalArgumentException, SignatureException
-
calculateHMAC
public String calculateHMAC(NotificationRequestItem notificationRequestItem, String key) throws IllegalArgumentException, SignatureException
-
validateHMAC
public boolean validateHMAC(String hmacSignature, String hmacKey, String payload) throws SignatureException
- Throws:
SignatureException
-
validateHMAC
public boolean validateHMAC(NotificationRequestItem notificationRequestItem, String key) throws IllegalArgumentException, SignatureException
-
getDataToSign
public String getDataToSign(NotificationRequestItem notificationRequestItem) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-