com.sun.jersey.oauth.signature
Class RSA_SHA1
java.lang.Object
com.sun.jersey.oauth.signature.RSA_SHA1
- All Implemented Interfaces:
- OAuthSignatureMethod
public class RSA_SHA1
- extends Object
- implements OAuthSignatureMethod
An OAuth signature method that implements RSA-SHA1.
- Author:
- Hubert A. Le Van Gong , Paul C. Bryan
Method Summary |
String |
name()
Returns the name of this signature method, as negotiated through the
OAuth protocol. |
String |
sign(String elements,
OAuthSecrets secrets)
Generates the RSA-SHA1 signature of OAuth request elements. |
boolean |
verify(String elements,
OAuthSecrets secrets,
String signature)
Verifies the RSA-SHA1 signature of OAuth request elements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final String NAME
- See Also:
- Constant Field Values
RSA_SHA1
public RSA_SHA1()
name
public String name()
- Description copied from interface:
OAuthSignatureMethod
- Returns the name of this signature method, as negotiated through the
OAuth protocol.
- Specified by:
name
in interface OAuthSignatureMethod
sign
public String sign(String elements,
OAuthSecrets secrets)
throws InvalidSecretException
- Generates the RSA-SHA1 signature of OAuth request elements.
- Specified by:
sign
in interface OAuthSignatureMethod
- Parameters:
elements
- 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,
OAuthSecrets secrets,
String signature)
throws InvalidSecretException
- Verifies the RSA-SHA1 signature of OAuth request elements.
- Specified by:
verify
in interface OAuthSignatureMethod
- 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.
Copyright © 2013 Oracle Corporation. All Rights Reserved.