org.jpos.security
Class SimpleKeyFile
java.lang.Object
org.jpos.security.SimpleKeyFile
- All Implemented Interfaces:
- Configurable, SecureKeyStore, LogSource
public class SimpleKeyFile
- extends Object
- implements SecureKeyStore, Configurable, LogSource
Implements SecureKeyStore using a properties file.
- Version:
- $Revision$ $Date$
- Author:
- Hani S. Kirollos
- See Also:
Properties
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected Logger logger
realm
protected String realm
SimpleKeyFile
public SimpleKeyFile()
SimpleKeyFile
public SimpleKeyFile(String keyFileName)
throws SecureKeyStore.SecureKeyStoreException
- Throws:
SecureKeyStore.SecureKeyStoreException
init
public void init(String keyFileName)
throws SecureKeyStore.SecureKeyStoreException
- Throws:
SecureKeyStore.SecureKeyStoreException
setLogger
public void setLogger(Logger logger,
String realm)
- Specified by:
setLogger in interface LogSource
getLogger
public Logger getLogger()
- Specified by:
getLogger in interface LogSource
getRealm
public String getRealm()
- Specified by:
getRealm in interface LogSource
setConfiguration
public void setConfiguration(Configuration cfg)
throws ConfigurationException
- Specified by:
setConfiguration in interface Configurable
- Parameters:
cfg - configuration object
- Throws:
ConfigurationException
getKey
public SecureKey getKey(String alias)
throws SecureKeyStore.SecureKeyStoreException
- Description copied from interface:
SecureKeyStore
- returns the key assiciated with the given alias
- Specified by:
getKey in interface SecureKeyStore
- Parameters:
alias - the alias name
- Returns:
- the requested key, or null if the given alias does not exist.
- Throws:
SecureKeyStore.SecureKeyStoreException - if SecureKeyStore is not initialized or if
the operation fails for some other reason.
setKey
public void setKey(String alias,
SecureKey secureKey)
throws SecureKeyStore.SecureKeyStoreException
- Description copied from interface:
SecureKeyStore
- Assigns the given key to the given alias.
If the given alias already exists, the keystore information associated
with it is overridden by the given key.
- Specified by:
setKey in interface SecureKeyStore
- Parameters:
alias - the alias namesecureKey - the key to be associated with the alias
- Throws:
SecureKeyStore.SecureKeyStoreException - if SecureKeyStore is not initialized or the key
can't be recovered.
getProperty
public String getProperty(String alias,
String subName)
throws SecureKeyStore.SecureKeyStoreException
- Throws:
SecureKeyStore.SecureKeyStoreException
setProperty
public void setProperty(String alias,
String subName,
String value)
getKeys
public Map<String,SecureKey> getKeys()
throws SecureKeyStore.SecureKeyStoreException
- Description copied from interface:
SecureKeyStore
- return map of existing keys assiciated with aliases.
- Specified by:
getKeys in interface SecureKeyStore
- Returns:
- map of existing keys assiciated with aliases.
- Throws:
SecureKeyStore.SecureKeyStoreException
Copyright © 1998-2012 jPOS.org. All Rights Reserved.