net.adamcin.httpsig.api
Class Authorization
java.lang.Object
net.adamcin.httpsig.api.Authorization
- All Implemented Interfaces:
- Serializable
public final class Authorization
- extends Object
- implements Serializable
Representation of the "Authorization: Signature..." header sent by the client in response to a Challenge
- See Also:
- Serialized Form
Authorization
public Authorization(String keyId,
String signature,
List<String> headers,
Algorithm algorithm)
- Construct an
Authorization instance
- Parameters:
keyId - the key identifiersignature - the Base64-encoded Signatureheaders - the list of signed headersalgorithm - the signing algorithm used
getKeyId
public String getKeyId()
getSignature
public String getSignature()
- Returns:
- the signature as a Base64-encoded string
getSignatureBytes
public byte[] getSignatureBytes()
- Returns:
- the signature as an unencoded byte array for verification using a
Verifier
getHeaders
public List<String> getHeaders()
getAlgorithm
public Algorithm getAlgorithm()
getHeaderValue
public String getHeaderValue()
- Returns:
- the constructed
Authorization header value
toString
public String toString()
- Overrides:
toString in class Object
parse
public static Authorization parse(String header)
- Parse an Authorization header value to construct an
Authorization instance
- Parameters:
header - the Authorization header value
- Returns:
- the
Authorization instance
Copyright © 2013-2014. All Rights Reserved.