public class HMAC_SHA1SignatureMethod extends Object implements OAuthSignatureMethod
Modifier and Type | Field and Description |
---|---|
static String |
MAC_NAME
The MAC name (for interfacing with javax.crypto.*).
|
static String |
SIGNATURE_NAME
The name of this HMAC-SHA1 signature method ("HMAC-SHA1").
|
Constructor and Description |
---|
HMAC_SHA1SignatureMethod(SecretKey key)
Construct a HMAC-SHA1 signature method with the given HMAC-SHA1 key.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
The name of this HMAC-SHA1 signature method ("HMAC-SHA1").
|
SecretKey |
getSecretKey()
The secret key.
|
String |
sign(String signatureBaseString)
Sign the signature base string.
|
void |
verify(String signatureBaseString,
String signature)
Verify the signature of the given signature base string.
|
public static final String SIGNATURE_NAME
public static final String MAC_NAME
public HMAC_SHA1SignatureMethod(SecretKey key)
key
- The key.public String getName()
getName
in interface OAuthSignatureMethod
public String sign(String signatureBaseString)
sign
in interface OAuthSignatureMethod
signatureBaseString
- The signature base string.public void verify(String signatureBaseString, String signature) throws InvalidSignatureException
verify
in interface OAuthSignatureMethod
signatureBaseString
- The signature base string.signature
- The signature.InvalidSignatureException
- If the signature is invalid for the specified base string.public SecretKey getSecretKey()
Copyright © 2019. All rights reserved.