Interface OAuth1SignatureMethod
-
- All Known Implementing Classes:
HmaSha1Method
,PlaintextMethod
,RsaSha1Method
@Contract public interface OAuth1SignatureMethod
An interface representing the OAuth signature method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
name()
Returns the name of this signature method, as negotiated through the OAuth protocol.java.lang.String
sign(java.lang.String baseString, OAuth1Secrets secrets)
Signs the data using the supplied secret(s).boolean
verify(java.lang.String elements, OAuth1Secrets secrets, java.lang.String signature)
Verifies the signature for the data using the supplied secret(s).
-
-
-
Method Detail
-
name
java.lang.String name()
Returns the name of this signature method, as negotiated through the OAuth protocol.- Returns:
- Signature method name.
-
sign
java.lang.String sign(java.lang.String baseString, OAuth1Secrets secrets) throws InvalidSecretException
Signs the data using the supplied secret(s).- Parameters:
baseString
- aString
that contains the request baseString to be signed.secrets
- the secret(s) to use to sign the data.- Returns:
- a
String
that contains the signature. - Throws:
InvalidSecretException
- if a supplied secret is not valid.
-
verify
boolean verify(java.lang.String elements, OAuth1Secrets secrets, java.lang.String signature) throws InvalidSecretException
Verifies the signature for the data using the supplied secret(s).- Parameters:
elements
- aString
that contains the request elements to be verified.secrets
- the secret(s) to use to verify the signature.signature
- aString
that 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.
-
-