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 storeIOException
CertificateException
KeyStoreException
NoSuchAlgorithmException
public 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.IOException
CertificateException
NoSuchAlgorithmException
InvalidKeySpecException
KeyStoreException
public static void updateWithSelfSignedServerCertificate(KeyStore pKeyStore) throws NoSuchProviderException, NoSuchAlgorithmException, IOException, InvalidKeyException, CertificateException, SignatureException, KeyStoreException
pKeyStore
- keystore to updateNoSuchProviderException
NoSuchAlgorithmException
IOException
InvalidKeyException
CertificateException
SignatureException
KeyStoreException
Copyright © 2018. All rights reserved.