public class PrivateKeys extends Object
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
loadFromKeyStore(InputStream keyStream,
String storePass,
String alias,
String keyPass)
Retrieves the private key from the specified key store stream using default key store.
|
static PrivateKey |
loadFromKeyStore(KeyStore keyStore,
InputStream keyStream,
String storePass,
String alias,
String keyPass)
Retrieves the private key from the specified key store stream and specified key store.
|
static PrivateKey |
loadFromP12File(File p12File,
String storePass,
String alias,
String keyPass)
Reads a
PKCS#12 format private key from a given file. |
static PrivateKey |
loadFromPk8File(File file)
Reads a
PKCS#8 format private key from a given file. |
public static PrivateKey loadFromKeyStore(InputStream keyStream, String storePass, String alias, String keyPass) throws IOException, GeneralSecurityException
keyStream - input stream to the key store file (closed at the end of this method in a
finally block)storePass - password protecting the key store filealias - alias under which the private key is storedkeyPass - password protecting the private keyIOExceptionGeneralSecurityExceptionpublic static PrivateKey loadFromKeyStore(KeyStore keyStore, InputStream keyStream, String storePass, String alias, String keyPass) throws IOException, GeneralSecurityException
keyStore - key storekeyStream - input stream to the key store file (closed at the end of this method in a
finally block)storePass - password protecting the key store filealias - alias under which the private key is storedkeyPass - password protecting the private keyIOExceptionGeneralSecurityExceptionpublic static PrivateKey loadFromPk8File(File file) throws IOException, GeneralSecurityException
PKCS#8 format private key from a given file.IOExceptionGeneralSecurityExceptionpublic static PrivateKey loadFromP12File(File p12File, String storePass, String alias, String keyPass) throws GeneralSecurityException, IOException
PKCS#12 format private key from a given file.p12File - p12 filestorePass - password protecting the key store filealias - alias under which the private key is storedkeyPass - password protecting the private keyGeneralSecurityExceptionIOExceptionCopyright © 2011-2012 Google. All Rights Reserved.