public class

OAuthRsaSha1Signer

extends Object
implements OAuthSigner
java.lang.Object
   ↳ com.google.gdata.client.authn.oauth.OAuthRsaSha1Signer

Class Overview

Signs strings using RSA-SHA1.

Summary

Fields
PrivateKey privateKey
Public Constructors
OAuthRsaSha1Signer()
Constructor for OAuthRsaSha1Signer.
OAuthRsaSha1Signer(PrivateKey privateKey)
Sets the RSA-SHA1 private key object used to sign this request.
OAuthRsaSha1Signer(String privateKeyString)
Sets the RSA-SHA1 private key object used to sign this request.
OAuthRsaSha1Signer(byte[] privateKeyBytes)
Sets the RSA-SHA1 private key object used to sign this request.
Public Methods
String getSignature(String baseString, OAuthParameters oauthParameters)
Signs the input string using the appropriate signature method.
String getSignatureMethod()
Gets the signature method for this specific implementation.
void setPrivateKey(PrivateKey privateKey)
Sets the java.security.PrivateKey used to sign requests.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.client.authn.oauth.OAuthSigner

Fields

PrivateKey privateKey

Public Constructors

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.

public OAuthRsaSha1Signer (PrivateKey privateKey)

Sets the RSA-SHA1 private key object used to sign this request.

Parameters
privateKey The java.security.PrivateKey to use to initialize the signer.
Throws
OAuthException if setting the private key fails

public OAuthRsaSha1Signer (String privateKeyString)

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

public OAuthRsaSha1Signer (byte[] privateKeyBytes)

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

Public Methods

public String getSignature (String baseString, OAuthParameters oauthParameters)

Signs the input string using the appropriate signature method.

Parameters
baseString The string to sign
oauthParameters The parameters related to the OAuth request or null
Returns
  • the signed string

public String getSignatureMethod ()

Gets the signature method for this specific implementation.

Returns
  • the signature method used to sign the base string

public void setPrivateKey (PrivateKey privateKey)

Sets the java.security.PrivateKey used to sign requests.

Parameters
privateKey
Throws
OAuthException if the private key is null.