Modifier and Type | Method and Description |
---|---|
static List<X509Certificate> |
getCertificateEntries(KeyStore keyStore)
Returns a list of all certificate entries of the supplied keystore.
|
static KeyStore |
loadKeyStore(InputStream keyStoreStream,
String keyStorePassword,
String keyStoreType) |
static KeyStore |
loadKeyStore(String keyStorePath,
String keyStorePassword,
String keyStoreType)
Loads a
KeyStore based on the given arguments. |
static KeyStore |
loadSystemTrustStore()
Loads a
KeyStore instance that contains the trusted certificates that the running system has configured. |
public static List<X509Certificate> getCertificateEntries(KeyStore keyStore) throws KeyStoreException
keyStore
- the keystore to read fromKeyStoreException
- for keystore access errorspublic static KeyStore loadSystemTrustStore() throws KeyStoreException
KeyStore
instance that contains the trusted certificates that the running system has configured.
using the following system properties:
javax.net.ssl.trustStore
- the path to the keystore holding the system trusted certificates.javax.net.ssl.trustStorePassword
- the password to unlock the keystore.javax.net.ssl.trustStoreType
- the type of the keystore. If this system property is not set the default
keystore type will be assumed.KeyStore
instance holding the system's trusted certificatesKeyStoreException
- for errors loading the system trust keystorepublic static KeyStore loadKeyStore(String keyStorePath, String keyStorePassword, String keyStoreType) throws KeyStoreException, IOException
KeyStore
based on the given arguments.keyStorePath
- the path to the key storekeyStorePassword
- the key store passwordkeyStoreType
- the type of the keystore (if null
the default keystore type will be assumed)KeyStore
instanceKeyStoreException
- for errors loading the keystoreIOException
- for IO errorspublic static KeyStore loadKeyStore(InputStream keyStoreStream, String keyStorePassword, String keyStoreType) throws KeyStoreException, IOException
KeyStoreException
IOException
Copyright © 2018 Litsec AB. All rights reserved.