| Constructor and Description |
|---|
OAuthSignatureMethod() |
| Modifier and Type | Method and Description |
|---|---|
static String |
base64Encode(byte[] b) |
static byte[] |
decodeBase64(String s) |
static String |
getBaseString(OAuthMessage message) |
protected String |
getConsumerSecret() |
protected String |
getSignature(OAuthMessage message) |
protected abstract String |
getSignature(String baseString)
Compute the signature for the given base string.
|
String |
getTokenSecret() |
protected void |
initialize(String name,
OAuthAccessor accessor) |
protected abstract boolean |
isValid(String signature,
String baseString)
Decide whether the signature is valid.
|
static OAuthSignatureMethod |
newMethod(String name,
OAuthAccessor accessor)
The factory for signature methods.
|
static OAuthSignatureMethod |
newSigner(OAuthMessage message,
OAuthAccessor accessor) |
protected static String |
normalizeParameters(Collection<? extends Map.Entry> parameters) |
protected static String |
normalizeUrl(String url) |
static void |
registerMethodClass(String name,
Class<?> clazz)
Subsequently, newMethod(name) will attempt to instantiate the given
class, with no constructor parameters.
|
protected void |
setConsumerSecret(String consumerSecret) |
void |
setTokenSecret(String tokenSecret) |
void |
sign(OAuthMessage message)
Add a signature to the message.
|
void |
validate(OAuthMessage message)
Check whether the message has a valid signature.
|
public static final String _ACCESSOR
public void sign(OAuthMessage message) throws OAuthException, IOException, URISyntaxException
public void validate(OAuthMessage message) throws IOException, OAuthException, URISyntaxException
URISyntaxExceptionOAuthProblemException - the signature is invalidIOExceptionOAuthExceptionprotected String getSignature(OAuthMessage message) throws OAuthException, IOException, URISyntaxException
protected void initialize(String name, OAuthAccessor accessor) throws OAuthException
OAuthExceptionprotected abstract String getSignature(String baseString) throws OAuthException
OAuthExceptionprotected abstract boolean isValid(String signature, String baseString) throws OAuthException
OAuthExceptionprotected String getConsumerSecret()
protected void setConsumerSecret(String consumerSecret)
public String getTokenSecret()
public void setTokenSecret(String tokenSecret)
public static String getBaseString(OAuthMessage message) throws IOException, URISyntaxException
IOExceptionURISyntaxExceptionprotected static String normalizeUrl(String url) throws URISyntaxException
URISyntaxExceptionprotected static String normalizeParameters(Collection<? extends Map.Entry> parameters) throws IOException
IOExceptionpublic static byte[] decodeBase64(String s)
public static String base64Encode(byte[] b)
public static OAuthSignatureMethod newSigner(OAuthMessage message, OAuthAccessor accessor) throws IOException, OAuthException
IOExceptionOAuthExceptionpublic static OAuthSignatureMethod newMethod(String name, OAuthAccessor accessor) throws OAuthException
OAuthExceptionCopyright 2015- Charles R. Severance and licensed CC-BY Attribution 4.0