Package net.libyaguide.gpay.sdk.crypto
Class ResponseVerifier
java.lang.Object
net.libyaguide.gpay.sdk.crypto.ResponseVerifier
Utility class for verifying API responses using HMAC signatures.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanverifyResponse(String secretKey, String password, GPayApiClient.ApiResponse response, Map<String, String> responseFields) Verifies the response signature using the provided secret key and password.
-
Constructor Details
-
ResponseVerifier
public ResponseVerifier()
-
-
Method Details
-
verifyResponse
public static boolean verifyResponse(String secretKey, String password, GPayApiClient.ApiResponse response, Map<String, String> responseFields) throws ExceptionVerifies the response signature using the provided secret key and password.- Parameters:
secretKey- The secret key for HMAC.password- The password used in hash token generation.response- The API response to verify.responseFields- The response fields to include in the hash.- Returns:
- true if the response is valid, false otherwise.
- Throws:
Exception- if verification fails.
-