T - Type of key, either SecretKey or PrivateKey.public class KeyStoreBasedKeyFactoryBean<T extends java.security.Key> extends java.lang.Object implements FactoryBean<T>
SecretKey or PrivateKey.
from a KeyStore.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
alias
Alias of keystore entry containing secret key.
|
private java.security.KeyStore |
keyStore
Keystore containing secret key.
|
private java.lang.String |
password
Password required to read key entry.
|
| Constructor and Description |
|---|
KeyStoreBasedKeyFactoryBean()
Creates a new instance.
|
KeyStoreBasedKeyFactoryBean(java.security.KeyStore keyStore,
java.lang.String alias,
java.lang.String password)
Creates a new instance by specifying all properties.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlias() |
java.security.KeyStore |
getKeyStore() |
T |
newInstance() |
void |
setAlias(java.lang.String alias)
Sets the alias that specifies the
KeyStore entry containing the key. |
void |
setKeyStore(java.security.KeyStore keyStore)
Sets the keystore that contains the key.
|
void |
setPassword(java.lang.String password)
Sets the password used to access the key entry.
|
private java.security.KeyStore keyStore
private java.lang.String alias
private java.lang.String password
public KeyStoreBasedKeyFactoryBean()
public KeyStoreBasedKeyFactoryBean(java.security.KeyStore keyStore,
java.lang.String alias,
java.lang.String password)
keyStore - Key store containing encryption key.alias - Name of encryption key entry in key store.password - Password used to decrypt key entry in keystore.public java.security.KeyStore getKeyStore()
keyStore.public void setKeyStore(java.security.KeyStore keyStore)
keyStore - Non-null keystore.public java.lang.String getAlias()
KeyStore entry containing the key.public void setAlias(java.lang.String alias)
KeyStore entry containing the key.alias - Keystore alias of key entry.public void setPassword(java.lang.String password)
password - Key entry password.public T newInstance()
newInstance in interface FactoryBean<T extends java.security.Key>