Class SnsAuthorizationInfo

java.lang.Object
net.solarnetwork.security.SnsAuthorizationInfo

public class SnsAuthorizationInfo extends Object
SNS authorization info
Version:
1.0
Author:
matt
  • Constructor Details

    • SnsAuthorizationInfo

      public SnsAuthorizationInfo(String scheme, String identifier, String[] headerNames, String signature)
      Constructor.
      Parameters:
      scheme - the schema (i.e. SNS
      identifier - the identifier (credential)
      headerNames - the signed header name list
      signature - the computed signature, as a hex-encoded string
      Throws:
      IllegalArgumentException - if any argument is null
  • Method Details

    • forAuthorizationHeader

      public static SnsAuthorizationInfo forAuthorizationHeader(String authorizationHeader)
      Parse an authorization header value into a SnsAuthorizationInfo instance.
      Parameters:
      authorizationHeader - the header to parse
      Returns:
      the instance
      Throws:
      IllegalArgumentException - if the header cannot be parsed for any reason
    • getScheme

      public String getScheme()
      Get the authorization scheme.
      Returns:
      the scheme, never null
    • getIdentifier

      public String getIdentifier()
      Get the identifier (credential).
      Returns:
      the identifier, never null
    • getHeaderNames

      public String[] getHeaderNames()
      Get the header name list.
      Returns:
      the header names, never null
    • getSignature

      public String getSignature()
      Get the signature.
      Returns:
      the signature as a hex-encoded string, never null