Package nl.altindag.ssl.util
Class KeyStoreUtils
java.lang.Object
nl.altindag.ssl.util.KeyStoreUtils
- Author:
- Hakan Altindag
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Certificate>
voidAdds the provides list of certificates to the given keystore path on the filesystem if exists.static <T extends Certificate>
voidstatic <T extends Certificate>
booleancontainsCertificate(KeyStore keyStore, T certificate) static booleancontainsIdentityMaterial(KeyStore keyStore) static booleancontainsTrustMaterial(KeyStore keyStore) static intcountAmountOfIdentityMaterial(KeyStore keyStore) static intcountAmountOfTrustMaterial(KeyStore keyStore) static KeyStorecreateIdentityStore(Key privateKey, char[] privateKeyPassword, String alias, List<? extends Certificate> certificateChain) static <T extends Certificate>
KeyStorecreateIdentityStore(Key privateKey, char[] privateKeyPassword, String alias, T... certificateChain) static KeyStorecreateIdentityStore(Key privateKey, char[] privateKeyPassword, List<? extends Certificate> certificateChain) static <T extends Certificate>
KeyStorecreateIdentityStore(Key privateKey, char[] privateKeyPassword, T... certificateChain) static KeyStorestatic KeyStorecreateKeyStore(char[] keyStorePassword) static KeyStorecreateKeyStore(String keyStoreType, char[] keyStorePassword) static <T extends Certificate>
KeyStorecreateTrustStore(List<T> certificates) static <T extends X509TrustManager>
KeyStorecreateTrustStore(T... trustManagers) getAliases(KeyStore keyStore) static Map<String,Certificate> getAliasToCertificate(KeyStore keyStore) static List<Certificate>getCertificates(KeyStore keyStore) static KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword) static KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType) static KeyStoreloadKeyStore(String keystorePath, char[] keystorePassword) static KeyStoreloadKeyStore(String keystorePath, char[] keystorePassword, String keystoreType) static KeyStoreloadKeyStore(Path keystorePath, char[] keystorePassword) static KeyStoreloadKeyStore(Path keystorePath, char[] keystorePassword, String keystoreType) static void
-
Field Details
-
DUMMY_PASSWORD
- See Also:
-
-
Method Details
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
public static KeyStore loadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType) -
createIdentityStore
public static KeyStore createIdentityStore(Key privateKey, char[] privateKeyPassword, String alias, List<? extends Certificate> certificateChain) -
createIdentityStore
public static KeyStore createIdentityStore(Key privateKey, char[] privateKeyPassword, List<? extends Certificate> certificateChain) -
createIdentityStore
@SafeVarargs public static <T extends Certificate> KeyStore createIdentityStore(Key privateKey, char[] privateKeyPassword, T... certificateChain) -
createIdentityStore
@SafeVarargs public static <T extends Certificate> KeyStore createIdentityStore(Key privateKey, char[] privateKeyPassword, String alias, T... certificateChain) -
createKeyStore
-
createKeyStore
-
createKeyStore
-
createTrustStore
@SafeVarargs public static <T extends X509TrustManager> KeyStore createTrustStore(T... trustManagers) -
createTrustStore
-
createTrustStore
-
loadSystemKeyStores
-
getCertificates
-
getAliasToCertificate
-
getAliases
-
containsCertificate
-
write
-
add
public static <T extends Certificate> void add(Path keystorePath, char[] password, String keystoreType, List<T> certificates) Adds the provides list of certificates to the given keystore path on the filesystem if exists. If the keystore is absent it will create it with the given password and also add the certificates. -
add
-
countAmountOfTrustMaterial
-
countAmountOfIdentityMaterial
-
containsTrustMaterial
-
containsIdentityMaterial
-