Class DefaultSigner

java.lang.Object
com.mdsol.mauth.DefaultSigner
All Implemented Interfaces:
Signer

public class DefaultSigner extends Object implements Signer
  • Constructor Details

    • DefaultSigner

      public DefaultSigner(SignerConfiguration configuration)
    • DefaultSigner

      public DefaultSigner(UUID appUUID, String privateKey)
    • DefaultSigner

      public DefaultSigner(UUID appUUID, String privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider)
    • DefaultSigner

      public DefaultSigner(UUID appUUID, PrivateKey privateKey)
    • DefaultSigner

      public DefaultSigner(UUID appUUID, PrivateKey privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider)
    • DefaultSigner

      public DefaultSigner(UUID appUUID, String privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider, List<com.mdsol.mauth.MAuthVersion> signVersions)
    • DefaultSigner

      public DefaultSigner(UUID appUUID, PrivateKey privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider, List<com.mdsol.mauth.MAuthVersion> signVersions)
  • Method Details

    • generateRequestHeaders

      @Deprecated public Map<String,String> generateRequestHeaders(String httpVerb, String requestPath, String requestPayload) throws com.mdsol.mauth.exceptions.MAuthSigningException
      Deprecated.
      Description copied from interface: Signer
      Generates the mAuth headers from the provided HTTP request data for Mauth V1. NOTE: mAuth headers are time sensitive. The headers must be verified by the receiving service within 5 minutes of being generated otherwise the request will fail.
      Specified by:
      generateRequestHeaders in interface Signer
      Parameters:
      httpVerb - The HTTP verb of the request, e.g. GET, POST, etc.
      requestPath - The path of the request, not including protocol, host or query parameters.
      requestPayload - The payload of the request
      Returns:
      MAuth headers which should be appended to the request before sending.
      Throws:
      com.mdsol.mauth.exceptions.MAuthSigningException - when request cannot be signed
    • generateRequestHeaders

      public Map<String,String> generateRequestHeaders(String httpVerb, String requestPath, byte[] requestPayload, String queryParameters) throws com.mdsol.mauth.exceptions.MAuthSigningException
      Description copied from interface: Signer
      Generates the mAuth headers from the provided HTTP request data for Mauth V2(and V1) protocol NOTE: mAuth headers are time sensitive. The headers must be verified by the receiving service within 5 minutes of being generated otherwise the request will fail.
      Specified by:
      generateRequestHeaders in interface Signer
      Parameters:
      httpVerb - The HTTP verb of the request, e.g. GET, POST, etc.
      requestPath - The path of the request, not including protocol, host or query parameters.
      requestPayload - The payload of the request
      queryParameters - The query parameters (URL-encoded)
      Returns:
      MAuth headers which should be appended to the request before sending.
      Throws:
      com.mdsol.mauth.exceptions.MAuthSigningException - when request cannot be signed
    • generateRequestHeaders

      public Map<String,String> generateRequestHeaders(String httpVerb, String requestPath, InputStream requestPayload, String queryParameters) throws com.mdsol.mauth.exceptions.MAuthSigningException
      Description copied from interface: Signer
      Generates the mAuth headers from the provided HTTP request data for Mauth V2 or V1 protocol NOTE: mAuth headers are time sensitive. The headers must be verified by the receiving service within 5 minutes of being generated otherwise the request will fail.
      Specified by:
      generateRequestHeaders in interface Signer
      Parameters:
      httpVerb - The HTTP verb of the request, e.g. GET, POST, etc.
      requestPath - The path of the request, not including protocol, host or query parameters.
      requestPayload - The payload of the request
      queryParameters - The query parameters (URL-encoded)
      Returns:
      MAuth headers which should be appended to the request before sending.
      Throws:
      com.mdsol.mauth.exceptions.MAuthSigningException - when request cannot be signed