public class

RsaSha1PrivateKeyHelper

extends Object
java.lang.Object
   ↳ com.google.gdata.client.authn.oauth.RsaSha1PrivateKeyHelper

Class Overview

A collection of methods to load an RSA-SHA1 java.security.PrivateKey object from various sources. The key should be a Base-64 encoded private key string conforming to the PKCS #8 standard.

Summary

Public Methods
static PrivateKey getPrivateKey(File file)
Retrieves a java.security.PrivateKey from a file.
static PrivateKey getPrivateKey(byte[] privateKeyBytes)
Retrieves a java.security.PrivateKey from an array of bytes.
static PrivateKey getPrivateKey(Reader privateKeyReader)
Retrieves a java.security.PrivateKey from a reader.
static PrivateKey getPrivateKey(String privateKeyString)
Retrieves a java.security.PrivateKey from a string.
static PrivateKey getPrivateKeyFromFilename(String filename)
Retrieves a java.security.PrivateKey from a file.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static PrivateKey getPrivateKey (File file)

Retrieves a java.security.PrivateKey from a file.

Parameters
file The java.io.File object from which to load the private key.
Returns
  • A java.security.PrivateKey object.
Throws
NoSuchAlgorithmException
Base64DecoderException
IOException
InvalidKeySpecException

public static PrivateKey getPrivateKey (byte[] privateKeyBytes)

Retrieves a java.security.PrivateKey from an array of bytes.

Parameters
privateKeyBytes The array of bytes from which to load the private key.
Returns
  • A java.security.PrivateKey object.
Throws
NoSuchAlgorithmException
InvalidKeySpecException

public static PrivateKey getPrivateKey (Reader privateKeyReader)

Retrieves a java.security.PrivateKey from a reader.

Parameters
privateKeyReader The java.io.Reader object from which to load the private key.
Returns
  • A java.security.PrivateKey object.
Throws
NoSuchAlgorithmException
Base64DecoderException
IOException
InvalidKeySpecException

public static PrivateKey getPrivateKey (String privateKeyString)

Retrieves a java.security.PrivateKey from a string.

Parameters
privateKeyString The string from which to load the private key.
Returns
  • A java.security.PrivateKey object.
Throws
NoSuchAlgorithmException
Base64DecoderException
InvalidKeySpecException

public static PrivateKey getPrivateKeyFromFilename (String filename)

Retrieves a java.security.PrivateKey from a file.

Parameters
filename The filename from which to load the private key.
Returns
  • A java.security.PrivateKey object.
Throws
NoSuchAlgorithmException
Base64DecoderException
IOException
InvalidKeySpecException