Interface OAuth1SignatureMethod
- All Known Implementing Classes:
HmaSha1Method,PlaintextMethod,RsaSha1Method
An interface representing the OAuth signature method.
- Author:
- Hubert A. Le Van Gong <hubert.levangong at Sun.COM>, Paul C. Bryan <pbryan@sun.com>
-
Method Summary
Modifier and TypeMethodDescriptionname()Returns the name of this signature method, as negotiated through the OAuth protocol.sign(String baseString, OAuth1Secrets secrets) Signs the data using the supplied secret(s).booleanverify(String elements, OAuth1Secrets secrets, String signature) Verifies the signature for the data using the supplied secret(s).
-
Method Details
-
name
String name()Returns the name of this signature method, as negotiated through the OAuth protocol.- Returns:
- Signature method name.
-
sign
Signs the data using the supplied secret(s).- Parameters:
baseString- aStringthat contains the request baseString to be signed.secrets- the secret(s) to use to sign the data.- Returns:
- a
Stringthat contains the signature. - Throws:
InvalidSecretException- if a supplied secret is not valid.
-
verify
boolean verify(String elements, OAuth1Secrets secrets, String signature) throws InvalidSecretException Verifies the signature for the data using the supplied secret(s).- Parameters:
elements- aStringthat contains the request elements to be verified.secrets- the secret(s) to use to verify the signature.signature- aStringthat contains the signature to be verified.- Returns:
- true if the signature matches the secrets and data.
- Throws:
InvalidSecretException- if a supplied secret is not valid.
-