Package com.mdsol.mauth
Class DefaultSigner
java.lang.Object
com.mdsol.mauth.DefaultSigner
- All Implemented Interfaces:
Signer
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSigner(SignerConfiguration configuration) DefaultSigner(UUID appUUID, String privateKey) DefaultSigner(UUID appUUID, String privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider) DefaultSigner(UUID appUUID, String privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider, List<com.mdsol.mauth.MAuthVersion> signVersions) DefaultSigner(UUID appUUID, PrivateKey privateKey) DefaultSigner(UUID appUUID, PrivateKey privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider) DefaultSigner(UUID appUUID, PrivateKey privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider, List<com.mdsol.mauth.MAuthVersion> signVersions) -
Method Summary
Modifier and TypeMethodDescriptiongenerateRequestHeaders(String httpVerb, String requestPath, byte[] requestPayload, String queryParameters) Generates the mAuth headers from the provided HTTP request data for Mauth V2(and V1) protocol NOTE: mAuth headers are time sensitive.generateRequestHeaders(String httpVerb, String requestPath, InputStream requestPayload, String queryParameters) Generates the mAuth headers from the provided HTTP request data for Mauth V2 or V1 protocol NOTE: mAuth headers are time sensitive.generateRequestHeaders(String httpVerb, String requestPath, String requestPayload) Deprecated.
-
Constructor Details
-
DefaultSigner
-
DefaultSigner
-
DefaultSigner
-
DefaultSigner
-
DefaultSigner
public DefaultSigner(UUID appUUID, PrivateKey privateKey, com.mdsol.mauth.util.EpochTimeProvider epochTimeProvider) -
DefaultSigner
-
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:SignerGenerates 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:
generateRequestHeadersin interfaceSigner- 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:SignerGenerates 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:
generateRequestHeadersin interfaceSigner- 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 requestqueryParameters- 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:SignerGenerates 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:
generateRequestHeadersin interfaceSigner- 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 requestqueryParameters- 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
-