net.adamcin.httpsig.api
Class Authorization

java.lang.Object
  extended by 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

Constructor Summary
Authorization(String keyId, String signature, List<String> headers, Algorithm algorithm)
          Construct an Authorization instance
 
Method Summary
 Algorithm getAlgorithm()
           
 List<String> getHeaders()
           
 String getHeaderValue()
           
 String getKeyId()
           
 String getSignature()
           
 byte[] getSignatureBytes()
           
static Authorization parse(String header)
          Parse an Authorization header value to construct an Authorization instance
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Authorization

public Authorization(String keyId,
                     String signature,
                     List<String> headers,
                     Algorithm algorithm)
Construct an Authorization instance

Parameters:
keyId - the key identifier
signature - the Base64-encoded Signature
headers - the list of signed headers
algorithm - the signing algorithm used
Method Detail

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.