Google Data APIs Client Library (1.41.1)



com.google.gdata.client.authn.oauth
Class OAuthRsaSha1Signer

java.lang.Object
  extended by com.google.gdata.client.authn.oauth.OAuthRsaSha1Signer
All Implemented Interfaces:
OAuthSigner

public class OAuthRsaSha1Signer
extends java.lang.Object
implements OAuthSigner

Signs strings using RSA-SHA1.


Constructor Summary
OAuthRsaSha1Signer()
          Constructor for OAuthRsaSha1Signer.
OAuthRsaSha1Signer(byte[] privateKeyBytes)
          Sets the RSA-SHA1 private key object used to sign this request.
OAuthRsaSha1Signer(java.security.PrivateKey privateKey)
          Sets the RSA-SHA1 private key object used to sign this request.
OAuthRsaSha1Signer(java.lang.String privateKeyString)
          Sets the RSA-SHA1 private key object used to sign this request.
 
Method Summary
 java.lang.String getSignature(java.lang.String baseString, OAuthParameters oauthParameters)
          Signs the input string using the appropriate signature method.
 java.lang.String getSignatureMethod()
          Gets the signature method for this specific implementation.
 void setPrivateKey(java.security.PrivateKey privateKey)
          Sets the PrivateKey used to sign requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuthRsaSha1Signer

public OAuthRsaSha1Signer()
Constructor for OAuthRsaSha1Signer. This form of the constructor does not set the private key, so be sure to call setPrivateKey(PrivateKey) before signing requests.


OAuthRsaSha1Signer

public OAuthRsaSha1Signer(java.security.PrivateKey privateKey)
                   throws OAuthException
Sets the RSA-SHA1 private key object used to sign this request.

Parameters:
privateKey - the PrivateKey to use to initialize the signer.
Throws:
OAuthException - if setting the private key fails

OAuthRsaSha1Signer

public OAuthRsaSha1Signer(java.lang.String privateKeyString)
                   throws OAuthException
Sets the RSA-SHA1 private key object used to sign this request.

Parameters:
privateKeyString - the Base-64 encoded private key string conforming to the PKCS #8 standard.
Throws:
OAuthException - if setting the private key fails

OAuthRsaSha1Signer

public OAuthRsaSha1Signer(byte[] privateKeyBytes)
                   throws OAuthException
Sets the RSA-SHA1 private key object used to sign this request.

Parameters:
privateKeyBytes - the Base-64 encoded private key conforming to the PKCS #8 standard.
Throws:
OAuthException - if setting the private key fails
Method Detail

setPrivateKey

public void setPrivateKey(java.security.PrivateKey privateKey)
                   throws OAuthException
Sets the PrivateKey used to sign requests.

Parameters:
privateKey -
Throws:
OAuthException - if the private key is null.

getSignature

public java.lang.String getSignature(java.lang.String baseString,
                                     OAuthParameters oauthParameters)
                              throws OAuthException
Description copied from interface: OAuthSigner
Signs the input string using the appropriate signature method.

Specified by:
getSignature in interface OAuthSigner
Parameters:
baseString - the string to sign
oauthParameters - the parameters related to the OAuth request or null
Returns:
the signed string
Throws:
OAuthException - if signing the request fails

getSignatureMethod

public java.lang.String getSignatureMethod()
Description copied from interface: OAuthSigner
Gets the signature method for this specific implementation.

Specified by:
getSignatureMethod in interface OAuthSigner
Returns:
the signature method used to sign the base string