SecurityUtils instead.@Deprecated public class PrivateKeys extends Object
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
loadFromKeyStore(InputStream keyStream,
String storePass,
String alias,
String keyPass)
Deprecated.
(scheduled to be removed in 1.15) Use
SecurityUtils.loadPrivateKeyFromKeyStore(java.security.KeyStore, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) with
SecurityUtils.getDefaultKeyStore() instead |
static PrivateKey |
loadFromKeyStore(KeyStore keyStore,
InputStream keyStream,
String storePass,
String alias,
String keyPass)
Deprecated.
(scheduled to be removed in 1.15) Use
SecurityUtils.loadPrivateKeyFromKeyStore(java.security.KeyStore, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) instead. |
static PrivateKey |
loadFromP12File(File p12File,
String storePass,
String alias,
String keyPass)
Deprecated.
(scheduled to be removed in 1.15) Use
SecurityUtils.loadPrivateKeyFromKeyStore(java.security.KeyStore, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) with
SecurityUtils.getPkcs12KeyStore() instead |
static PrivateKey |
loadFromPkcs8PemFile(File pemFile)
Deprecated.
(scheduled to be removed in 1.15) Use
PemReader.readFirstSectionAndClose(java.io.Reader, String) instead. |
static byte[] |
readFromPemFormattedFile(File file)
Deprecated.
(scheduled to be removed in 1.15) Use
PemReader.readFirstSectionAndClose(java.io.Reader, String) instead. |
@Deprecated public static PrivateKey loadFromKeyStore(InputStream keyStream, String storePass, String alias, String keyPass) throws IOException, GeneralSecurityException
SecurityUtils.loadPrivateKeyFromKeyStore(java.security.KeyStore, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) with
SecurityUtils.getDefaultKeyStore() insteadkeyStream - 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 keyIOExceptionGeneralSecurityException@Deprecated public static PrivateKey loadFromKeyStore(KeyStore keyStore, InputStream keyStream, String storePass, String alias, String keyPass) throws IOException, GeneralSecurityException
SecurityUtils.loadPrivateKeyFromKeyStore(java.security.KeyStore, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) instead.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 keyIOExceptionGeneralSecurityException@Deprecated public static byte[] readFromPemFormattedFile(File file) throws IOException, GeneralSecurityException
PemReader.readFirstSectionAndClose(java.io.Reader, String) instead.PEM formatted private key from a given file.
This supports any file if and only if it contains a DER and Base64 encoded key, and the contents are enclosed by the following:
-----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----
The file may contain additional content outside of the BEGIN and END tags, but it will be ignored. This method does not support additional content such as headers inside the BEGIN and END tags. If the file contains multiple BEGIN and END tags, only the content inside the first pair will be read.
IOExceptionGeneralSecurityException@Deprecated public static PrivateKey loadFromPkcs8PemFile(File pemFile) throws IOException, GeneralSecurityException
PemReader.readFirstSectionAndClose(java.io.Reader, String) instead.PEM formatted PKCS8 encoded private key from a given file.
This method uses readFromPemFormattedFile(java.io.File), and the file formatting requirements from
that method apply.
IOExceptionGeneralSecurityException@Deprecated public static PrivateKey loadFromP12File(File p12File, String storePass, String alias, String keyPass) throws GeneralSecurityException, IOException
SecurityUtils.loadPrivateKeyFromKeyStore(java.security.KeyStore, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) with
SecurityUtils.getPkcs12KeyStore() insteadPKCS#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-2013 Google. All Rights Reserved.