public final class KeyStoreBuilder extends Object
Modifier and Type | Method and Description |
---|---|
KeyStore |
create()
Creates the key store.
|
static KeyStoreBuilder |
empty()
A builder for an empty key store.
|
static KeyStoreBuilder |
fromFile(Path file)
A builder for a key store initialized from a key store file.
|
static KeyStoreBuilder |
fromJavaHome()
A builder for a key store initialized from
{JAVA_HOME}/lib/security/cacerts . |
KeyStoreBuilder |
setPassword(String password)
Sets the key store password.
|
KeyStoreBuilder |
setPasswordKey(EncryptionKey passwordKey)
Sets the password encryption key.
|
KeyStoreBuilder |
setProvider(String provider)
Sets the security provider name.
|
KeyStoreBuilder |
setType(String type)
Sets the key store type.
|
public KeyStoreBuilder setProvider(String provider)
provider
- provider namepublic KeyStoreBuilder setType(String type)
type
- key store typepublic KeyStoreBuilder setPassword(String password)
password
- key store password.public KeyStoreBuilder setPasswordKey(EncryptionKey passwordKey)
passwordKey
- password keyEncryptionKey
public KeyStore create() throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException, NoSuchProviderException
NoSuchAlgorithmException
- problem creating key storeCertificateException
- problem creating key storeIOException
- problem creating key storeKeyStoreException
- problem creating key storeNoSuchProviderException
- problem creating key storepublic static KeyStoreBuilder fromJavaHome()
{JAVA_HOME}/lib/security/cacerts
.public static KeyStoreBuilder fromFile(Path file)
file
- key store filepublic static KeyStoreBuilder empty()
Copyright © 2008–2023 Norconex Inc.. All rights reserved.