|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.adamcin.httpsig.hmac.HmacKey
public class HmacKey
| Constructor Summary | |
|---|---|
HmacKey(String keyId,
String secret)
Instantiates a new HMAC key with an identifier and a secret used to sign |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HmacKey(String keyId,
String secret)
keyId - The keys identifiersecret - The secret used to sign| Method Detail |
|---|
public String getId()
getId in interface KeyKey's self-identification. This may end up not being unique within a keychain.public Set<Algorithm> getAlgorithms()
getAlgorithms in interface KeySet of Signature Algorithms supported by this key.public boolean canVerify()
canVerify in interface Key
public boolean verify(Algorithm algorithm,
byte[] contentBytes,
byte[] signatureBytes)
signatureBytes against the challengeHash using an underlying public key
verify in interface Keyalgorithm - the selected Signature AlgorithmcontentBytes - the result of RequestContent.getContent(java.util.List, java.nio.charset.Charset)signatureBytes - the result of Authorization.getSignatureBytes()
public boolean canSign()
canSign in interface Key
public byte[] sign(Algorithm algorithm,
byte[] contentBytes)
challengeHash using the specified signature Algorithm
sign in interface Keyalgorithm - the selected Signature AlgorithmcontentBytes - the result of RequestContent.getContent(java.util.List, java.nio.charset.Charset)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||