Class HmaSha1Method
java.lang.Object
org.glassfish.jersey.oauth1.signature.HmaSha1Method
- All Implemented Interfaces:
OAuth1SignatureMethod
An OAuth signature method that implements HMAC-SHA1.
- Author:
- Hubert A. Le Van Gong <hubert.levangong at Sun.COM>, Paul C. Bryan <pbryan@sun.com>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionname()Returns the name of this signature method, as negotiated through the OAuth protocol.sign(String baseString, OAuth1Secrets secrets) Generates the HMAC-SHA1 signature of OAuth request elements.booleanverify(String elements, OAuth1Secrets secrets, String signature) Verifies the HMAC-SHA1 signature of OAuth request elements.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
HmaSha1Method
public HmaSha1Method()
-
-
Method Details
-
name
Description copied from interface:OAuth1SignatureMethodReturns the name of this signature method, as negotiated through the OAuth protocol.- Specified by:
namein interfaceOAuth1SignatureMethod- Returns:
- Signature method name.
-
sign
Generates the HMAC-SHA1 signature of OAuth request elements.- Specified by:
signin interfaceOAuth1SignatureMethod- Parameters:
baseString- the combined OAuth elements to sign.secrets- the shared secrets used to sign the request.- Returns:
- the OAuth signature, in base64-encoded form.
-
verify
Verifies the HMAC-SHA1 signature of OAuth request elements.- Specified by:
verifyin interfaceOAuth1SignatureMethod- Parameters:
elements- OAuth elements signature is to be verified against.secrets- the shared secrets for verifying the signature.signature- base64-encoded OAuth signature to be verified.- Returns:
- true if the signature matches the secrets and data.
-