base.jdbs.cryptography
Class KeyRing<K>

java.lang.Object
  extended by base.jdbs.cryptography.KeyRing<K>
Direct Known Subclasses:
AsymmetricKeyRing

public abstract class KeyRing<K>
extends java.lang.Object


Constructor Summary
KeyRing()
           
 
Method Summary
protected  void add(java.lang.Integer id, K object)
          This method adds to the KeyRing the target object.
protected  K get(java.lang.Integer id)
          This method retrieves a stored element by id.
protected  java.util.Collection<K> getAll()
          This method returns a collection of all stored elements.
protected  java.lang.Integer nextElementId()
          This method computes a new Id for a KeyPair.
protected  void remove(java.lang.Integer id)
          This method removes a stored element from the KeyRing.
protected  void removeAll()
          This method removes all the stored elements from the KeyRing.
abstract  java.security.KeyStore retrieve(java.io.File location, java.lang.String password)
          This method retrieves the content of a stored key ring from a file system location.
abstract  void store(java.io.File location, java.lang.String password)
          This method saves the content of the key ring in a file system location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyRing

public KeyRing()
Method Detail

nextElementId

protected java.lang.Integer nextElementId()
This method computes a new Id for a KeyPair.

Returns:
A new Id for a KeyPair.

add

protected void add(java.lang.Integer id,
                   K object)
This method adds to the KeyRing the target object.

Parameters:
id - The id associated to the object.
object - The object to be added.

remove

protected void remove(java.lang.Integer id)
This method removes a stored element from the KeyRing.

Parameters:
id - The id associated to the element to remove.

removeAll

protected void removeAll()
This method removes all the stored elements from the KeyRing.


get

protected K get(java.lang.Integer id)
This method retrieves a stored element by id.

Parameters:
id - The id associated to the element to retrieve.
Returns:
The stored element otherwise null.

getAll

protected java.util.Collection<K> getAll()
This method returns a collection of all stored elements.

Returns:
A collection of stored elements.

store

public abstract void store(java.io.File location,
                           java.lang.String password)
This method saves the content of the key ring in a file system location.

Parameters:
location - The location where the key ring must be stored.
password - The password associated to the file.

retrieve

public abstract java.security.KeyStore retrieve(java.io.File location,
                                                java.lang.String password)
This method retrieves the content of a stored key ring from a file system location.

Parameters:
location - The location from wich the content of the key ring must be retrieved.
password - The password associated to the file.
Returns:
The KeyStore associated to the input location, null if the input location isn't a valid key store archive.


Copyright © 2006 SF.net. All Rights Reserved.