public final class PemKeyStore extends Object
| Constructor and Description |
|---|
PemKeyStore() |
| Modifier and Type | Method and Description |
|---|---|
static KeyStore |
buildKeyStore(java.nio.file.Path certChainFile,
java.nio.file.Path keyFile,
char[] keyPasswordChars)
Generates a new
KeyStore. |
protected static PKCS8EncodedKeySpec |
generateKeySpec(char[] password,
byte[] key)
Generates a key specification for an (encrypted) private key.
|
protected static PKCS8EncodedKeySpec generateKeySpec(char[] password, byte[] key) throws IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeySpecException, InvalidKeyException, InvalidAlgorithmParameterException
password - characters, if null or empty an unencrypted key is assumedkey - bytes of the DER encoded private keyIOException - if parsing key failsNoSuchAlgorithmException - if the algorithm used to encrypt key is unkownNoSuchPaddingException - if the padding scheme specified in the decryption algorithm is unkownInvalidKeySpecException - if the decryption key based on password cannot be generatedInvalidKeyException - if the decryption key based on password cannot be used to decrypt
keyInvalidAlgorithmParameterException - if decryption algorithm parameters are somehow faultypublic static KeyStore buildKeyStore(java.nio.file.Path certChainFile, java.nio.file.Path keyFile, char[] keyPasswordChars) throws KeyStoreException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException, CertificateException, KeyException, IOException
KeyStore.certChainFile - a X.509 certificate chain file in PEM format,keyFile - a PKCS#8 private key file in PEM format,keyPasswordChars - the password of the keyFile.
null if it's not password-protected.KeyStore.KeyStoreExceptionNoSuchAlgorithmExceptionNoSuchPaddingExceptionInvalidKeySpecExceptionInvalidAlgorithmParameterExceptionCertificateExceptionKeyExceptionIOExceptionCopyright © 2012-2016 Graylog, Inc.. All Rights Reserved.