Package net.solarnetwork.security
Class SnsAuthorizationInfo
java.lang.Object
net.solarnetwork.security.SnsAuthorizationInfo
SNS authorization info
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionSnsAuthorizationInfo(String scheme, String identifier, String[] headerNames, String signature) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic SnsAuthorizationInfoforAuthorizationHeader(String authorizationHeader) Parse an authorization header value into aSnsAuthorizationInfoinstance.String[]Get the header name list.Get the identifier (credential).Get the authorization scheme.Get the signature.
-
Constructor Details
-
SnsAuthorizationInfo
public SnsAuthorizationInfo(String scheme, String identifier, String[] headerNames, String signature) Constructor.- Parameters:
scheme- the schema (i.e. SNSidentifier- the identifier (credential)headerNames- the signed header name listsignature- the computed signature, as a hex-encoded string- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
forAuthorizationHeader
Parse an authorization header value into aSnsAuthorizationInfoinstance.- Parameters:
authorizationHeader- the header to parse- Returns:
- the instance
- Throws:
IllegalArgumentException- if the header cannot be parsed for any reason
-
getScheme
Get the authorization scheme.- Returns:
- the scheme, never null
-
getIdentifier
Get the identifier (credential).- Returns:
- the identifier, never null
-
getHeaderNames
Get the header name list.- Returns:
- the header names, never null
-
getSignature
Get the signature.- Returns:
- the signature as a hex-encoded string, never null
-