|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.security.oauth.common.signature.RSA_SHA1SignatureMethod
public class RSA_SHA1SignatureMethod
RSA-SHA1 signature method. The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in RFC3447 section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for EMSA-PKCS1-v1_5.
| Field Summary | |
|---|---|
static String |
SIGNATURE_NAME
The name of this RSA-SHA1 signature method ("RSA-SHA1"). |
| Constructor Summary | |
|---|---|
RSA_SHA1SignatureMethod(PrivateKey key)
Construct a RSA-SHA1 signature method with the given RSA-SHA1 private key. |
|
RSA_SHA1SignatureMethod(PrivateKey privateKey,
PublicKey publicKey)
Construct a RSA-SHA1 signature method with the given RSA-SHA1 public/private key pair. |
|
RSA_SHA1SignatureMethod(PublicKey key)
Construct a RSA-SHA1 signature method with the given RSA-SHA1 public key. |
|
| Method Summary | |
|---|---|
String |
getName()
The name of this RSA-SHA1 signature method ("RSA-SHA1"). |
PrivateKey |
getPrivateKey()
The private key. |
PublicKey |
getPublicKey()
The private key. |
String |
sign(String signatureBaseString)
The Signature Base String is signed using the Consumer’s RSA private key per RFC3447 section 8.2.1, where K is the Consumer’s RSA private key, M the Signature Base String, and S is the result signature octet string: S = RSASSA-PKCS1-V1_5-SIGN (K, M) oauth_signature is set to S, first base64-encoded per RFC2045 section 6.8, then URL-encoded per Parameter Encoding. |
void |
verify(String signatureBaseString,
String signature)
Verify the signature of the given signature base string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SIGNATURE_NAME
| Constructor Detail |
|---|
public RSA_SHA1SignatureMethod(PrivateKey privateKey,
PublicKey publicKey)
privateKey - The private key.publicKey - The public key.public RSA_SHA1SignatureMethod(PrivateKey key)
key - The key.public RSA_SHA1SignatureMethod(PublicKey key)
key - The key.| Method Detail |
|---|
public String getName()
getName in interface OAuthSignatureMethodpublic String sign(String signatureBaseString)
sign in interface OAuthSignatureMethodsignatureBaseString - The signature base string.
UnsupportedOperationException - If there is no private key.
public void verify(String signatureBaseString,
String signature)
throws InvalidSignatureException
verify in interface OAuthSignatureMethodsignatureBaseString - The signature base string.signature - The signature.
InvalidSignatureException - If the signature is invalid for the specified base string.
UnsupportedOperationException - If there is no public key.public PrivateKey getPrivateKey()
public PublicKey getPublicKey()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||