Constructor and Description |
---|
KeyStoreUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addPrivateKey(KeyStore keyStore,
File pemKeyFile,
char[] passwordChars,
List<Certificate> certChain)
Adds a private key to the specified key store from the passed private key file and certificate chain.
|
static PrivateKey |
createPrivateKey(File pemKeyFile,
char[] passwordChars)
Creates a
PrivateKey instance from the passed private key PEM format file and certificate chain. |
static KeyStore |
loadKeyStore(File file,
String password)
Attempts to load the specified file as a
KeyStore , determining the key store type from the file extension. |
public static KeyStore loadKeyStore(File file, String password) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
KeyStore
, determining the key store type from the file extension.file
- password
- KeyStore
instance loaded from the specified file.KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException
public static void addPrivateKey(KeyStore keyStore, File pemKeyFile, char[] passwordChars, List<Certificate> certChain) throws IOException, GeneralSecurityException
keyStore
- The key store to receive the private key.pemKeyFile
- A PEM format file containing the private key.passwordChars
- The password that protects the private key.certChain
- The certificate chain to associate with the private key.IOException
GeneralSecurityException
public static PrivateKey createPrivateKey(File pemKeyFile, char[] passwordChars) throws IOException, GeneralSecurityException
PrivateKey
instance from the passed private key PEM format file and certificate chain.pemKeyFile
- A PEM format file containing the private key.passwordChars
- The password that protects the private key.IOException
GeneralSecurityException
Copyright © 2016 International Business Machines Corporation. All rights reserved.