public class KeyStoreUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
updateWithCaPem(KeyStore pTrustStore,
File pCaCert)
Update a keystore with a CA certificate
|
static void |
updateWithSelfSignedServerCertificate(KeyStore pKeyStore)
Update the given keystore with a self signed server certificate.
|
static void |
updateWithServerPems(KeyStore pKeyStore,
File pServerCert,
File pServerKey,
String pKeyAlgo,
char[] pPassword)
Update a key store with the keys found in a server PEM and its key file.
|
public static void updateWithCaPem(KeyStore pTrustStore, File pCaCert) throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException
pTrustStore - the keystore to updatepCaCert - CA cert as PEM used for the trust storeIOExceptionCertificateExceptionKeyStoreExceptionNoSuchAlgorithmExceptionpublic static void updateWithServerPems(KeyStore pKeyStore, File pServerCert, File pServerKey, String pKeyAlgo, char[] pPassword) throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException
pKeyStore - keystore to updatepServerCert - server certificatepServerKey - server keypKeyAlgo - algorithm used in the keystore (e.g. "RSA")pPassword - password to use for the key file. must not be null, use char[0]
for an empty password.IOExceptionCertificateExceptionNoSuchAlgorithmExceptionInvalidKeySpecExceptionKeyStoreExceptionpublic static void updateWithSelfSignedServerCertificate(KeyStore pKeyStore) throws NoSuchAlgorithmException, KeyStoreException
pKeyStore - keystore to updateNoSuchAlgorithmExceptionKeyStoreExceptionCopyright © 2022. All rights reserved.