public final class KeyStoreBuilder extends Object
Constructor and Description |
---|
KeyStoreBuilder() |
Modifier and Type | Method and Description |
---|---|
KeyStore |
build()
Builds and loads the keystore using the provided parameters.
|
KeyStoreBuilder |
withInputStream(InputStream inputStream)
Specifies the input stream to load the keystore from.
|
KeyStoreBuilder |
withKeyStoreFile(File keyStoreFile)
Specifies the file to load the keystore from.
|
KeyStoreBuilder |
withKeyStoreFile(String keyStoreFile)
Specifies the file to load the keystore from.
|
KeyStoreBuilder |
withKeyStoreType(KeyStoreType type)
Specifies the type of keystore to load.
|
KeyStoreBuilder |
withLoadStoreParameter(KeyStore.LoadStoreParameter loadStoreParameter)
Specifies the
KeyStore.LoadStoreParameter to use to load the KeyStore . |
KeyStoreBuilder |
withPassword(char[] password)
Specifies the password to unlock the keystore.
|
KeyStoreBuilder |
withPassword(String password)
Specifies the password to unlock the keystore.
|
KeyStoreBuilder |
withProvider(Provider provider)
Specifies the security provider to use for the keystore.
|
KeyStoreBuilder |
withProvider(String providerName)
Specifies the security provider to use for the keystore.
|
public KeyStoreBuilder withInputStream(InputStream inputStream)
null
to create a fresh keystore.
Note: the input stream will be closed automatically after the keystore is loaded.
inputStream
- the input stream to load the keystore from.public KeyStoreBuilder withKeyStoreFile(File keyStoreFile) throws FileNotFoundException
keyStoreFile
- the keystore file to load.FileNotFoundException
- if the file does not exist, is not a file, or cannot be read.public KeyStoreBuilder withKeyStoreFile(String keyStoreFile) throws FileNotFoundException
keyStoreFile
- the name of keystore file to load.FileNotFoundException
- if the file does not exist, is not a file, or cannot be read.public KeyStoreBuilder withKeyStoreType(KeyStoreType type)
type
- the type of keystore to load. May not be null.public KeyStoreBuilder withPassword(char[] password)
password
- the password to unlock the keystore.public KeyStoreBuilder withPassword(String password)
password
- the password to use. May not be null.withPassword(char[])
public KeyStoreBuilder withProvider(Provider provider)
provider
- the security provider. May not be null.public KeyStoreBuilder withProvider(String providerName)
providerName
- the name of the provider to use.IllegalArgumentException
- if no such provider exists.public KeyStoreBuilder withLoadStoreParameter(KeyStore.LoadStoreParameter loadStoreParameter)
KeyStore.LoadStoreParameter
to use to load the KeyStore
.loadStoreParameter
- the KeyStore.LoadStoreParameter
.public KeyStore build()
Copyright © 2025 Open Identity Platform Community. All rights reserved.