public final class PemKeyStore extends Object
| Constructor and Description |
|---|
PemKeyStore() |
| Modifier and Type | Method and Description |
|---|---|
static KeyStore |
buildKeyStore(Path certChainFile,
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, org.bouncycastle.pkcs.PKCSException, org.bouncycastle.operator.OperatorCreationException
password - characters, if null or empty an unencrypted key is assumedkey - bytes of the DER encoded private keyIOException - if parsing key failsorg.bouncycastle.pkcs.PKCSException - if the decryption key based on password cannot be used to decrypt
keyorg.bouncycastle.operator.OperatorCreationException - if the decryption algorithm parameters are somehow faultypublic static KeyStore buildKeyStore(Path certChainFile, Path keyFile, char[] keyPasswordChars) throws GeneralSecurityException
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.GeneralSecurityException - on any error regarding key generationCopyright © 2012–2021 Graylog, Inc.. All rights reserved.