| Constructor and Description |
|---|
HmacKey(java.lang.String keyId,
java.lang.String secret)
Instantiates a new HMAC key with an identifier and a secret used to sign
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSign()
HMAC Keys can always be used to sign
|
boolean |
canVerify()
HMAC Keys can always be used to verify
|
java.util.Set<Algorithm> |
getAlgorithms() |
java.lang.String |
getId() |
byte[] |
sign(Algorithm algorithm,
byte[] contentBytes)
Signs the
challengeHash using the specified signature Algorithm |
boolean |
verify(Algorithm algorithm,
byte[] contentBytes,
byte[] signatureBytes)
Verifies the
signatureBytes against the challengeHash using an underlying public key |
public HmacKey(java.lang.String keyId,
java.lang.String secret)
keyId - The keys identifiersecret - The secret used to signpublic java.lang.String getId()
public java.util.Set<Algorithm> getAlgorithms()
getAlgorithms in interface KeySet of Signature Algorithms supported by this key.public boolean canVerify()
public boolean verify(Algorithm algorithm, byte[] contentBytes, byte[] signatureBytes)
signatureBytes against the challengeHash using an underlying public keyverify in interface Keyalgorithm - the selected Signature AlgorithmcontentBytes - the result of RequestContent.getBytesToSign(java.util.List, java.nio.charset.Charset)signatureBytes - the result of Authorization.getSignatureBytes()public boolean canSign()
public byte[] sign(Algorithm algorithm, byte[] contentBytes)
challengeHash using the specified signature Algorithmsign in interface Keyalgorithm - the selected Signature AlgorithmcontentBytes - the result of RequestContent.getBytesToSign(java.util.List, java.nio.charset.Charset)Copyright © 2014-2017. All Rights Reserved.