public class RsaSha1PrivateKeyHelper extends Object
PrivateKey
object from various sources. The key should be a Base-64 encoded private key
string conforming to the PKCS #8 standard.| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
getPrivateKey(byte[] privateKeyBytes)
Retrieves a
PrivateKey from an array of bytes. |
static PrivateKey |
getPrivateKey(File file)
Retrieves a
PrivateKey from a file. |
static PrivateKey |
getPrivateKey(Reader privateKeyReader)
Retrieves a
PrivateKey from a reader. |
static PrivateKey |
getPrivateKey(String privateKeyString)
Retrieves a
PrivateKey from a string. |
static PrivateKey |
getPrivateKeyFromFilename(String filename)
Retrieves a
PrivateKey from a file. |
public static PrivateKey getPrivateKeyFromFilename(String filename) throws Base64DecoderException, InvalidKeySpecException, IOException, NoSuchAlgorithmException
PrivateKey from a file.filename - The filename from which to load the private key.PrivateKey object.Base64DecoderExceptionInvalidKeySpecExceptionIOExceptionNoSuchAlgorithmExceptionpublic static PrivateKey getPrivateKey(File file) throws Base64DecoderException, InvalidKeySpecException, IOException, NoSuchAlgorithmException
PrivateKey from a file.file - The File object from which to load the private
key.PrivateKey object.Base64DecoderExceptionInvalidKeySpecExceptionIOExceptionNoSuchAlgorithmExceptionpublic static PrivateKey getPrivateKey(Reader privateKeyReader) throws Base64DecoderException, InvalidKeySpecException, IOException, NoSuchAlgorithmException
PrivateKey from a reader.privateKeyReader - The Reader object from which to
load the private key.PrivateKey object.Base64DecoderExceptionInvalidKeySpecExceptionIOExceptionNoSuchAlgorithmExceptionpublic static PrivateKey getPrivateKey(String privateKeyString) throws Base64DecoderException, InvalidKeySpecException, NoSuchAlgorithmException
PrivateKey from a string.privateKeyString - The string from which to load the private key.PrivateKey object.Base64DecoderExceptionInvalidKeySpecExceptionNoSuchAlgorithmExceptionpublic static PrivateKey getPrivateKey(byte[] privateKeyBytes) throws InvalidKeySpecException, NoSuchAlgorithmException
PrivateKey from an array of bytes.privateKeyBytes - The array of bytes from which to load the private
key.PrivateKey object.InvalidKeySpecExceptionNoSuchAlgorithmExceptionCopyright © 2012. All Rights Reserved.