java.lang.Object
nl.altindag.ssl.util.KeyStoreUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceKeyStoreUtils.KeyStoreBiPredicate<T extends KeyStore,U> private static interfaceKeyStoreUtils.KeyStoreFunction<T,R extends KeyStore> private static interface -
Field Summary
Fields -
Constructor Summary
Constructors -
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>
voidprivate static intamountOfSpecifiedMaterial(KeyStore keyStore, KeyStoreUtils.KeyStoreBiPredicate<KeyStore, String> predicate, int upperBoundaryForMaterialCounter) static <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 KeyStorestatic KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword) static KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType) static KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType, String providerName) static KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType, Provider provider) private static KeyStoreloadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, KeyStoreUtils.KeyStoreSupplier keyStoreSupplier) static KeyStoreloadKeyStore(String keystorePath, char[] keystorePassword) static KeyStoreloadKeyStore(String keystorePath, char[] keystorePassword, String keystoreType) static KeyStoreloadKeyStore(String keystorePath, char[] keystorePassword, String keystoreType, String providerName) static KeyStoreloadKeyStore(String keystorePath, char[] keystorePassword, String keystoreType, Provider provider) private static KeyStoreloadKeyStore(String keystorePath, KeyStoreUtils.KeyStoreFunction<InputStream, KeyStore> keyStoreKeyStoreFunction) static KeyStoreloadKeyStore(Path keystorePath, char[] keystorePassword) static KeyStoreloadKeyStore(Path keystorePath, char[] keystorePassword, String keystoreType) static KeyStoreloadKeyStore(Path keystorePath, char[] keystorePassword, String keystoreType, String providerName) static KeyStoreloadKeyStore(Path keystorePath, char[] keystorePassword, String keystoreType, Provider provider) private static KeyStoreloadKeyStore(Path keystorePath, KeyStoreUtils.KeyStoreFunction<InputStream, KeyStore> mapper) static KeyStoreprivate static KeyStoreloadSystemPropertyDerivedKeyStore(String keyStorePathProperty, String keyStorePasswordProperty, String keyStoreTypeProperty, String keyStoreProviderProperty) static KeyStorestatic void
-
Field Details
-
LOGGER
private static final nl.altindag.sude.Logger LOGGER -
DUMMY_PASSWORD
- See Also:
-
KEYSTORE_TYPE
- See Also:
-
EMPTY_INPUT_STREAM_EXCEPTION_MESSAGE
- See Also:
-
KEYSTORE_NOT_FOUND_EXCEPTION_MESSAGE
-
EMPTY_TRUST_MANAGER_FOR_TRUSTSTORE_EXCEPTION
- See Also:
-
EMPTY_CERTIFICATES_EXCEPTION
- See Also:
-
-
Constructor Details
-
KeyStoreUtils
private KeyStoreUtils()
-
-
Method Details
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
private static KeyStore loadKeyStore(String keystorePath, KeyStoreUtils.KeyStoreFunction<InputStream, KeyStore> keyStoreKeyStoreFunction) -
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
-
loadKeyStore
private static KeyStore loadKeyStore(Path keystorePath, KeyStoreUtils.KeyStoreFunction<InputStream, KeyStore> mapper) -
loadKeyStore
-
loadKeyStore
public static KeyStore loadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType) -
loadKeyStore
public static KeyStore loadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType, String providerName) -
loadKeyStore
public static KeyStore loadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, String keystoreType, Provider provider) -
loadKeyStore
private static KeyStore loadKeyStore(InputStream keystoreInputStream, char[] keystorePassword, KeyStoreUtils.KeyStoreSupplier keyStoreSupplier) -
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
-
loadJdkKeyStore
-
loadSystemKeyStores
-
loadSystemPropertyDerivedKeyStore
-
loadSystemPropertyDerivedTrustStore
-
loadSystemPropertyDerivedKeyStore
-
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
-
amountOfSpecifiedMaterial
private static int amountOfSpecifiedMaterial(KeyStore keyStore, KeyStoreUtils.KeyStoreBiPredicate<KeyStore, String> predicate, int upperBoundaryForMaterialCounter)
-