All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.logi.crypto.keys.KeyRing

java.lang.Object
   |
   +----is.logi.crypto.Crypto
           |
           +----is.logi.crypto.keys.KeyRing

public class KeyRing
extends Crypto
implements KeySource
This implementation of the KeySource interface stores keys in a hash-table. It can be converted to and from a CDS for storage.

A database key-source would be more appropriate for large collections of keys, but hasn't been written yet. An interface to a key-server would be more appropriate for really huge key collections but will have to wait even longer.

The CDS for a KeyRing object is KeyRing(k1,k2,...,kn) with n>=0 and each ki the CDS for a KeyRecord or Key object.

Author:
Logi Ragnarsson (logir@hi.is)
See Also:
Key, KeyRecord

Constructor Index

 o KeyRing()
Create empty key ring.

Method Index

 o byFingerprint(Fingerprint)
Retreive the key with the given fingerprint.
 o insert(Key)
Insert the Key k into the KeyRing.
 o insert(KeyRecord)
Insert the KeyRecord k into the KeyRing.
 o parseCDS(String)
If "KeyRing( key )" is a valid CDS for a KeyRing, then KeyRing.parseCDS(key) will return the described KeyRing object.
 o toString()
Return a CDS for this KeyRing.

Constructors

 o KeyRing
 public KeyRing()
Create empty key ring.

Methods

 o parseCDS
 public static KeyRing parseCDS(String arg) throws InvalidCDSException
If "KeyRing( key )" is a valid CDS for a KeyRing, then KeyRing.parseCDS(key) will return the described KeyRing object.

A valid CDS can be created by calling the KeyRing.toString() method.

Throws: InvalidCDSException
if the CDS is malformed.
See Also:
fromString
 o toString
 public String toString()
Return a CDS for this KeyRing.

Overrides:
toString in class Object
 o insert
 public void insert(Key k)
Insert the Key k into the KeyRing. It will be wrapped in a KeyRecord containing empty strings and no certificates.

 o insert
 public void insert(KeyRecord kc)
Insert the KeyRecord k into the KeyRing.

 o byFingerprint
 public KeyRecord byFingerprint(Fingerprint fingerprint)
Retreive the key with the given fingerprint. If it is not found in the key-source, null is returned. fingerprint must be created with the same algorithm as the the Key object uses, which will be SHA1 for the Key classes included with Crypto.


All Packages  Class Hierarchy  This Package  Previous  Next  Index