public class SimpleKeyFile extends java.lang.Object implements SecureKeyStore, Configurable, LogSource
Properties
SecureKeyStore.SecureKeyStoreException
Modifier and Type | Field and Description |
---|---|
protected Logger |
logger |
protected java.lang.String |
realm |
Constructor and Description |
---|
SimpleKeyFile() |
SimpleKeyFile(java.lang.String keyFileName) |
Modifier and Type | Method and Description |
---|---|
SecureKey |
getKey(java.lang.String alias)
Returns the key assiciated with the given alias.
|
java.util.Map<java.lang.String,SecureKey> |
getKeys()
Returns map of existing keys assiciated with aliases.
|
Logger |
getLogger() |
java.lang.String |
getProperty(java.lang.String alias,
java.lang.String subName) |
java.lang.String |
getRealm() |
void |
init(java.lang.String keyFileName) |
void |
setConfiguration(Configuration cfg) |
void |
setKey(java.lang.String alias,
SecureKey secureKey)
Assigns the given key to the given alias.
|
void |
setLogger(Logger logger,
java.lang.String realm) |
void |
setProperty(java.lang.String alias,
java.lang.String subName,
java.lang.String value) |
protected Logger logger
protected java.lang.String realm
public SimpleKeyFile()
public SimpleKeyFile(java.lang.String keyFileName) throws SecureKeyStore.SecureKeyStoreException
public void init(java.lang.String keyFileName) throws SecureKeyStore.SecureKeyStoreException
public void setLogger(Logger logger, java.lang.String realm)
public void setConfiguration(Configuration cfg) throws ConfigurationException
setConfiguration
in interface Configurable
cfg
- configuration objectConfigurationException
public SecureKey getKey(java.lang.String alias) throws SecureKeyStore.SecureKeyStoreException
SecureKeyStore
getKey
in interface SecureKeyStore
alias
- the alias namenull
if the given alias does not exist.SecureKeyStore.SecureKeyStoreException
- if SecureKeyStore is not initialized or if
the operation fails for some other reason.public void setKey(java.lang.String alias, SecureKey secureKey) throws SecureKeyStore.SecureKeyStoreException
SecureKeyStore
setKey
in interface SecureKeyStore
alias
- the alias namesecureKey
- the key to be associated with the aliasSecureKeyStore.SecureKeyStoreException
- if SecureKeyStore is not initialized or the key
can't be recovered.public java.lang.String getProperty(java.lang.String alias, java.lang.String subName) throws SecureKeyStore.SecureKeyStoreException
public void setProperty(java.lang.String alias, java.lang.String subName, java.lang.String value)
public java.util.Map<java.lang.String,SecureKey> getKeys() throws SecureKeyStore.SecureKeyStoreException
SecureKeyStore
getKeys
in interface SecureKeyStore
SecureKeyStore.SecureKeyStoreException
- if SecureKeyStore is not initialized or if
the operation fails for some other reason.