public final class Signer extends Object
RequestContent
and create an Authorization
Constructor and Description |
---|
Signer(Keychain keychain) |
Signer(Keychain keychain,
KeyId keyId) |
Signer(Key singleKey,
KeyId keyId) |
Modifier and Type | Method and Description |
---|---|
Keychain |
getCandidateKeys() |
Keychain |
getKeychain() |
KeyId |
getKeyId() |
boolean |
rotateKeys()
Call this method to rotate the candidate keys back to the original state.
|
boolean |
rotateKeys(Challenge nextChallenge)
Call this method to rotate the candidate keys according to the provided
Challenge . |
boolean |
rotateKeys(Challenge nextChallenge,
Authorization failedAuthz)
Call this method to rotate the candidate keys
|
Authorization |
sign(RequestContent requestContent)
Signs a
RequestContent and returns an Authorization header. |
Authorization |
sign(RequestContent requestContent,
List<String> electiveHeaders)
Signs a
RequestContent and returns an Authorization header. |
public Signer(Keychain keychain)
public Keychain getCandidateKeys()
Challenge
-filtered and rotated Keychain
rotateKeys()
public KeyId getKeyId()
public boolean rotateKeys()
public boolean rotateKeys(Challenge nextChallenge)
Challenge
.nextChallenge
- the Challenge
header which was returned for the previous failed request.public boolean rotateKeys(Challenge nextChallenge, Authorization failedAuthz)
nextChallenge
- the Challenge
header which was returned for the previous failed request.failedAuthz
- the Authorization
header which failed on the previous request.public Authorization sign(RequestContent requestContent)
RequestContent
and returns an Authorization
header. The signature will use
all headers included in the RequestContent
.requestContent
- the Request containing the headers to be signedAuthorization
header or null if no identities could sign the RequestContent
public Authorization sign(RequestContent requestContent, List<String> electiveHeaders)
RequestContent
and returns an Authorization
header.requestContent
- the Request containing the headers to be signedelectiveHeaders
- a list of headers to include in the signature, beyond those required by
the Challenge
Authorization
header or null if no identities could sign the RequestContent
Copyright © 2013-2017. All Rights Reserved.