Class ResponseVerifier

java.lang.Object
net.libyaguide.gpay.sdk.crypto.ResponseVerifier

public class ResponseVerifier extends Object
Utility class for verifying API responses using HMAC signatures.
  • Constructor Details

    • ResponseVerifier

      public ResponseVerifier()
  • Method Details

    • verifyResponse

      public static boolean verifyResponse(String secretKey, String password, GPayApiClient.ApiResponse response, Map<String,String> responseFields) throws Exception
      Verifies 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.