Package org.cryptacular.bean
Class KeyStoreBasedKeyFactoryBean<T extends Key>
java.lang.Object
org.cryptacular.bean.KeyStoreBasedKeyFactoryBean<T>
- Type Parameters:
T
- Type of key, eitherSecretKey
orPrivateKey
.
- All Implemented Interfaces:
FactoryBean<T>
- Author:
- Middleware Services
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.KeyStoreBasedKeyFactoryBean
(KeyStore keyStore, String alias, String password) Creates a new instance by specifying all properties. -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
void
Sets the alias that specifies theKeyStore
entry containing the key.void
setKeyStore
(KeyStore keyStore) Sets the keystore that contains the key.void
setPassword
(String password) Sets the password used to access the key entry.
-
Constructor Details
-
KeyStoreBasedKeyFactoryBean
public KeyStoreBasedKeyFactoryBean()Creates a new instance. -
KeyStoreBasedKeyFactoryBean
Creates a new instance by specifying all properties.- Parameters:
keyStore
- Key store containing encryption key.alias
- Name of encryption key entry in key store.password
- Password used to decrypt key entry in keystore.
-
-
Method Details
-
getKeyStore
- Returns:
- Keystore that contains the
keyStore
.
-
setKeyStore
Sets the keystore that contains the key.- Parameters:
keyStore
- Non-null keystore.
-
getAlias
- Returns:
- Alias that specifies the
KeyStore
entry containing the key.
-
setAlias
Sets the alias that specifies theKeyStore
entry containing the key.- Parameters:
alias
- Keystore alias of key entry.
-
setPassword
Sets the password used to access the key entry.- Parameters:
password
- Key entry password.
-
newInstance
- Specified by:
newInstance
in interfaceFactoryBean<T extends Key>
- Returns:
- New instance of the type handled by this factory.
-