Constructor and Description |
---|
HmacKey(String keyId,
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
|
Set<Algorithm> |
getAlgorithms() |
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 String getId()
public Set<Algorithm> getAlgorithms()
getAlgorithms
in interface Key
Set
of Signature Algorithm
s 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 Key
algorithm
- the selected Signature Algorithm
contentBytes
- 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 Algorithm
sign
in interface Key
algorithm
- the selected Signature Algorithm
contentBytes
- the result of RequestContent.getBytesToSign(java.util.List, java.nio.charset.Charset)
Copyright © 2013-2017. All Rights Reserved.