org.jpos.security
Interface SecureKeyStore

All Known Implementing Classes:
SimpleKeyFile

public interface SecureKeyStore

Represents a collection of Secure Keys and typically stores them in some persistent storage. SecureKeyStore isolates from particular DB implementations. A Secure Key Store need not implement any security itself, it just holds keys that are inherently secure (like SecureDESKey).

Note: SecureKeyStore doesn't have any relation with java.security.KeyStore SecureKeyStore works on objects of type org.jpos.security.SecureKey

Version:
$Revision$ $Date$
Author:
Hani S. Kirollos
See Also:
SecureKey

Nested Class Summary
static class SecureKeyStore.SecureKeyStoreException
           
 
Method Summary
 SecureKey getKey(String alias)
          returns the key assiciated with the given alias
 Map<String,SecureKey> getKeys()
          return map of existing keys assiciated with aliases.
 void setKey(String alias, SecureKey key)
          Assigns the given key to the given alias.
 

Method Detail

getKey

SecureKey getKey(String alias)
                 throws SecureKeyStore.SecureKeyStoreException
returns the key assiciated with the given alias

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

void setKey(String alias,
            SecureKey key)
            throws SecureKeyStore.SecureKeyStoreException
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.

Parameters:
alias - the alias name
key - the key to be associated with the alias
Throws:
SecureKeyStore.SecureKeyStoreException - if SecureKeyStore is not initialized or the key can't be recovered.

getKeys

Map<String,SecureKey> getKeys()
                              throws SecureKeyStore.SecureKeyStoreException
return map of existing keys assiciated with aliases.

Returns:
map of existing keys assiciated with aliases.
Throws:
if - SecureKeyStore is not initialized or if the operation fails for some other reason.
SecureKeyStore.SecureKeyStoreException


Copyright © 1998-2012 jPOS.org. All Rights Reserved.