Class RsaSha1Method
java.lang.Object
org.glassfish.jersey.oauth1.signature.RsaSha1Method
- All Implemented Interfaces:
OAuth1SignatureMethod
An OAuth signature method that implements RSA-SHA1.
- Author:
- Hubert A. Le Van Gong <hubert.levangong at Sun.COM>, Paul C. Bryan <pbryan@sun.com>
-
Field Summary
-
Constructor Summary
-
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 RSA-SHA1 signature of OAuth request elements.boolean
verify
(String elements, OAuth1Secrets secrets, String signature) Verifies the RSA-SHA1 signature of OAuth request elements.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
RsaSha1Method
public RsaSha1Method()
-
-
Method Details
-
name
Description copied from interface:OAuth1SignatureMethod
Returns the name of this signature method, as negotiated through the OAuth protocol.- Specified by:
name
in interfaceOAuth1SignatureMethod
- Returns:
- Signature method name.
-
sign
Generates the RSA-SHA1 signature of OAuth request elements.- Specified by:
sign
in interfaceOAuth1SignatureMethod
- Parameters:
baseString
- the combined OAuth elements to sign.secrets
- the secrets object containing the private key for generating the signature.- Returns:
- the OAuth signature, in base64-encoded form.
- Throws:
InvalidSecretException
- if the supplied secret is not valid.
-
verify
public boolean verify(String elements, OAuth1Secrets secrets, String signature) throws InvalidSecretException Verifies the RSA-SHA1 signature of OAuth request elements.- Specified by:
verify
in interfaceOAuth1SignatureMethod
- Parameters:
elements
- OAuth elements signature is to be verified against.secrets
- the secrets object containing the public key for verifying the signature.signature
- base64-encoded OAuth signature to be verified.- Returns:
- true if the signature matches the secrets and data.
- Throws:
InvalidSecretException
- if the supplied secret is not valid.
-