Class HmacFunctions

java.lang.Object
flexagon.fd.services.groovy.functions.BaseFunctions
flexagon.fd.services.groovy.functions.HmacFunctions

public class HmacFunctions extends BaseFunctions
Utility functions for generating HMAC strings
Since:
5.3
  • Constructor Details

  • Method Details

    • generateHmacSHA512

      public String generateHmacSHA512(Object pPayload, String pSecret) throws FlexCheckedException
      Generates an HMAC string using the HmacSHA512 algorithm
      Parameters:
      pPayload - Payload to generate HMAC from. This payload should be untouched from the provider to generate the correct Hmac
      pSecret - Secret Key for generation
      Returns:
      Hmac string
      Throws:
      FlexCheckedException
    • generateHmacSHA384

      public String generateHmacSHA384(Object pPayload, String pSecret) throws FlexCheckedException
      Generates an HMAC string using the HmacSHA384 algorithm
      Parameters:
      pPayload - Payload to generate HMAC from. This payload should be untouched from the provider to generate the correct HMAC
      pSecret - Secret Key for generation
      Returns:
      Hmac string
      Throws:
      FlexCheckedException
    • generateHmacSHA256

      public String generateHmacSHA256(Object pPayload, String pSecret) throws FlexCheckedException
      Generates an Hmac string using the HmacSHA256 algorithm
      Parameters:
      pPayload - Payload to generate HMAC from. This payload should be untouched from the provider to generate the correct HMAC
      pSecret - Secret Key for generation
      Returns:
      Hmac string
      Throws:
      FlexCheckedException
    • generateHmacSHA1

      public String generateHmacSHA1(Object pPayload, String pSecret) throws FlexCheckedException
      Generates an HMAC string using the HmacSHA1 algorithm
      Parameters:
      pPayload - Payload to generate HMAC from. This payload should be untouched from the provider to generate the correct HMAC
      pSecret - Secret Key for generation
      Returns:
      HMAC string
      Throws:
      FlexCheckedException
    • generateHmac

      public String generateHmac(Object pPayload, String pSecret, String pAlgorithm) throws FlexCheckedException
      Generates an HMAC string
      Parameters:
      pPayload - Payload to generate HMAC from. This payload should be untouched from the provider to generate the correct HMAC
      pSecret - Secret Key for generation
      pAlgorithm - Algorithm to use. Java standard cryptographic algorithm names are used
      Returns:
      HMAC string
      Throws:
      FlexCheckedException
      See Also:
    • getGroovyKey

      public String getGroovyKey()
      Specified by:
      getGroovyKey in class BaseFunctions
    • cleanup

      public void cleanup()
      Specified by:
      cleanup in class BaseFunctions