All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.hi.logir.cryptonite.KeyRing

java.lang.Object
   |
   +----is.hi.logir.cryptonite.Cryptonite
           |
           +----is.hi.logir.cryptonite.KeyRing

public class KeyRing
extends Cryptonite
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.
 o KeyRing(String)
Called by Cryptonite.fromString(String) .

Method Index

 o byFingerprint(Fingerprint)
Return the key with the given fingerprint from the KeyRing if it is found.
 o insert(Key)
Insert the Key k into the KeyRing.
 o insert(KeyRecord)
Insert the KeyRecord k into the KeyRing.
 o toString()
Return a CDS for this KeyRing.

Constructors

 o KeyRing
 public KeyRing()
Create empty key ring.

 o KeyRing
 public KeyRing(String arg) throws InvalidCDSException
Called by Cryptonite.fromString(String) .

Throws: InvalidCDSException
if the CDS is in some way malformed.

Methods

 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)
Return the key with the given fingerprint from the KeyRing if it is found. Otherwise 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 Cryptonite.


All Packages  Class Hierarchy  This Package  Previous  Next  Index