public class KeyStoreUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger |
static String |
SUN_PROVIDER_NAME |
Constructor and Description |
---|
KeyStoreUtils() |
Modifier and Type | Method and Description |
---|---|
static KeyStore |
getKeyStore(String keyStoreType)
Returns an empty KeyStore backed by the appropriate provider
|
static String |
getKeyStoreProvider(String keyStoreType)
Returns the provider that will be used for the given keyStoreType
|
static KeyStore |
getTrustStore(String trustStoreType)
Returns an empty KeyStore intended for use as a TrustStore backed by the appropriate provider
|
static boolean |
isKeyPasswordCorrect(URL keystore,
KeystoreType keystoreType,
char[] password,
char[] keyPassword)
Returns true if the given keystore can be loaded using the given keystore type and password and the default
(first) alias can be retrieved with the key-specific password.
|
static boolean |
isStoreValid(URL keystore,
KeystoreType keystoreType,
char[] password)
Returns true if the given keystore can be loaded using the given keystore type and password.
|
private static final org.slf4j.Logger logger
public static final String SUN_PROVIDER_NAME
public static String getKeyStoreProvider(String keyStoreType)
keyStoreType
- the keyStoreTypepublic static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException
keyStoreType
- the keyStoreTypeKeyStoreException
- if a KeyStore of the given type cannot be instantiatedpublic static KeyStore getTrustStore(String trustStoreType) throws KeyStoreException
trustStoreType
- the trustStoreTypeKeyStoreException
- if a KeyStore of the given type cannot be instantiatedpublic static boolean isStoreValid(URL keystore, KeystoreType keystoreType, char[] password)
keystore
- the keystore to validatekeystoreType
- the type of the keystorepassword
- the password to access the keystorepublic static boolean isKeyPasswordCorrect(URL keystore, KeystoreType keystoreType, char[] password, char[] keyPassword)
keystore
- the keystore to validatekeystoreType
- the type of the keystorepassword
- the password to access the keystorekeyPassword
- the password to access the specific keyCopyright © 2020 Apache NiFi Project. All rights reserved.