|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.paypal.base.util.OAuthSignature
public class OAuthSignature
| Nested Class Summary | |
|---|---|
static class |
OAuthSignature.HTTPMethod
|
| Field Summary | |
|---|---|
static String |
OAUTH_VERSION
|
| Constructor Summary | |
|---|---|
OAuthSignature(String consumerKey,
String consumerSecret)
Default Constructor |
|
| Method Summary | |
|---|---|
void |
addParameter(String name,
String value)
Adds Parameter. |
String |
computeV1Signature()
Computes OAuth Signature as per OAuth specification using signature Method. |
static Map |
getAuthHeader(String apiUserName,
String apiPassword,
String accessToken,
String tokenSecret,
OAuthSignature.HTTPMethod httpMethod,
String scriptURI,
Map queryParams)
Accepts the required parameters and Provides OAuth signature and TimeStamp. |
static String |
getFullAuthString(String apiUserName,
String apiPassword,
String accessToken,
String tokenSecret,
OAuthSignature.HTTPMethod httpMethod,
String scriptURI,
Map queryParams)
Computes the value of the X_PP_AUTHORIZATION header |
void |
setHTTPMethod(OAuthSignature.HTTPMethod method)
Sets HTTP Method |
void |
setRequestURI(String uri)
Sets URI for signature computation. |
void |
setToken(String token)
Sets Token to be used to generate signature. |
void |
setTokenSecret(String secret)
Sets Token secret as received in Token response. |
void |
setTokenTimestamp(String timestamp)
Sets time stamp for signature computation. |
boolean |
verifyV1Signature(String signature)
verifyV1Signature verifies signature against computed signature. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String OAUTH_VERSION
| Constructor Detail |
|---|
public OAuthSignature(String consumerKey,
String consumerSecret)
consumerKey - - Consumer key shared between PayPal and Consumer (OAuth
consumer)consumerSecret - - Secret shared between PayPal and Consumer (OAuth consumer)| Method Detail |
|---|
public void setToken(String token)
token - - String version of Token. The token could be Access or
Request
public void addParameter(String name,
String value)
name - parameter name with no URL encoding appliedvalue - parameter value with no URL encoding appliedpublic void setTokenSecret(String secret)
secret - byte array of token secret
public void setRequestURI(String uri)
throws OAuthException
uri - - Script URI which will be normalized to
scheme://authority:port/path if not normalized already.
OAuthExceptionpublic void setTokenTimestamp(String timestamp)
timestamp - - time stamp at which Token request sends.public void setHTTPMethod(OAuthSignature.HTTPMethod method)
method - HTTP method used for sending OAuth request
public String computeV1Signature()
throws OAuthException
enc.
OAuthException - if invalid arguments.
public boolean verifyV1Signature(String signature)
throws OAuthException
OAuthException - in case there are any failures in signature computation.
public static Map getAuthHeader(String apiUserName,
String apiPassword,
String accessToken,
String tokenSecret,
OAuthSignature.HTTPMethod httpMethod,
String scriptURI,
Map queryParams)
throws OAuthException
apiUserName - API User name.apiPassword - API Password of user.accessToken - Obtained during Permission Request of token.tokenSecret - Obtained during Permission Request of token.httpMethod - HTTP Method (GET,POST etc.)scriptURI - API Server End Point.queryParams - Extra 'name/value' parameters if required.
Map of HTTPHeaders
OAuthException
public static String getFullAuthString(String apiUserName,
String apiPassword,
String accessToken,
String tokenSecret,
OAuthSignature.HTTPMethod httpMethod,
String scriptURI,
Map queryParams)
throws OAuthException
apiUserName - API User name.apiPassword - API Password of user.accessToken - Obtained during Permission Request of token.tokenSecret - Obtained during Permission Request of token.httpMethod - HTTP Method (GET,POST etc.)scriptURI - API Server End Point.queryParams - Extra 'name/value' parameters if required.
OAuthException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||