base.jdbs.cryptography.asymmetric
Class AsymmetricKeyRing

java.lang.Object
  extended by base.jdbs.cryptography.KeyRing<KeyPair>
      extended by base.jdbs.cryptography.asymmetric.AsymmetricKeyRing

public class AsymmetricKeyRing
extends KeyRing<KeyPair>


Field Summary
static java.lang.String CERTIFICATE_ENTRY
           
static java.lang.String KEY_ENTRY
           
 
Constructor Summary
AsymmetricKeyRing(User owner)
          The default constructor.
 
Method Summary
 void addKeyPair(KeyPair keyPair)
          This method adds a keypair to the collection.
 KeyPair[] getAllKeyPair()
          This method returns all the keypairs contained in the collection.
 KeyPair getKeyPair(java.lang.Integer keyPairId)
          This method retrieves a keypair givind its identifier.
 User getOwner()
           
protected  java.lang.Integer nextKeyPairId()
          This method computes a new Id for a KeyPair.
 void removeAllKeyPair()
          This method removes all the keypairs contained in the collection.
 void removeKeyPair(java.lang.Integer keyPairId)
          This method removes a keypair from the collection.
 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.
 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 base.jdbs.cryptography.KeyRing
add, get, getAll, nextElementId, remove, removeAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_ENTRY

public static final java.lang.String KEY_ENTRY
See Also:
Constant Field Values

CERTIFICATE_ENTRY

public static final java.lang.String CERTIFICATE_ENTRY
See Also:
Constant Field Values
Constructor Detail

AsymmetricKeyRing

public AsymmetricKeyRing(User owner)
The default constructor.

Method Detail

getOwner

public User getOwner()
Returns:
Returns the owner.

addKeyPair

public void addKeyPair(KeyPair keyPair)
This method adds a keypair to the collection.

Parameters:
keyPair - The keypair to be added.

removeKeyPair

public void removeKeyPair(java.lang.Integer keyPairId)
This method removes a keypair from the collection.

Parameters:
keyPairId - The keypair identifier associated to the keypair that must be removed from the collection.

removeAllKeyPair

public void removeAllKeyPair()
This method removes all the keypairs contained in the collection.


getKeyPair

public KeyPair getKeyPair(java.lang.Integer keyPairId)
This method retrieves a keypair givind its identifier.

Parameters:
keyPairId - The keypair identifier associated to the keypair that must be retrieved.
Returns:
The keypair whose identifier is keyPairId, null if the keyPairId is not associated to any keypair in the collection.

getAllKeyPair

public KeyPair[] getAllKeyPair()
This method returns all the keypairs contained in the collection.

Returns:
All the keypairs contained in the collection in array form.

nextKeyPairId

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

Returns:
A new Id for a KeyPair.

store

public void store(java.io.File location,
                  java.lang.String password)
Description copied from class: KeyRing
This method saves the content of the key ring in a file system location.

Specified by:
store in class KeyRing<KeyPair>
Parameters:
location - The location where the key ring must be stored.
password - The password associated to the file.

retrieve

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

Specified by:
retrieve in class KeyRing<KeyPair>
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.