Class EdgeGridV1Signer

java.lang.Object
com.akamai.edgegrid.signer.EdgeGridV1Signer

public class EdgeGridV1Signer extends Object

This class implements the EdgeGrid Request Signature algorithm described by API Client Authentication. All OPEN API requests should have a signature generated by getSignature(Request, ClientCredential) sent as their Authorization header.

This class is deliberately designed to be library-agnostic. Instances of this class hold no local state, so they can be re-used repeatedly to produce request signatures.

The main entry point to produce a signature is getSignature(Request, ClientCredential). This method's two arguments are immutable representations of exactly what they sound like: an API request and your client credentials. They should be built with their builder classes (Request.RequestBuilder and ClientCredential.ClientCredentialBuilder respectively).

Author:
[email protected], [email protected]
  • Constructor Details

    • EdgeGridV1Signer

      public EdgeGridV1Signer()
      Creates signer with default configuration.
  • Method Details

    • getSignature

      public String getSignature(Request request, ClientCredential credential) throws RequestSigningException
      Generates signature for a given HTTP request and client credential. The result of this method call should be appended as the "Authorization" header to an HTTP request.
      Parameters:
      request - a HTTP request to sign
      credential - client credential used to sign a request
      Returns:
      signature for Authorization HTTP header
      Throws:
      RequestSigningException - if signing of a given request failed
      NullPointerException - if request or credential is null
      IllegalArgumentException - if request contains multiple request headers with the same header name