org.logi.crypto.keys
Class KeyRecord

java.lang.Object
  extended byorg.logi.crypto.Crypto
      extended byorg.logi.crypto.keys.KeyRecord

public class KeyRecord
extends Crypto

This class holds a particular key, linking it to the owner's name and e-mail and annotation.

The CDS for a KeyRecord object is KeyRecord(key,ownerName,ownerMail,notes) where key is a CDF for a Key object and the other parameters are strings, which may be quoted.

Note that the key-certificate system is incomplete and is very likely to change drastically.

See Also:
Key, KeySource

Field Summary
 
Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
KeyRecord(Key key, java.lang.String ownerName, java.lang.String ownerMail, java.lang.String notes)
          Create a new KeyRecord.
 
Method Summary
 Fingerprint getFingerprint()
          Return the SHA1 fingerprint of this KeyRecord.
 Key getKey()
          Return the key from this record.
 java.lang.String getNotes()
          Return the notes about this key.
 java.lang.String getOwnerMail()
          Return the e-mail address of the key's owner.
 java.lang.String getOwnerName()
          Return the name of the key's owner.
static KeyRecord parseCDS(java.lang.String arg)
          If "KeyRecord( key )" is a valid CDS for a KeyRecord, then KeyRecord.parseCDS(key) will return the described KeyRecord object.
 java.lang.String toString()
          Return a CDS for this KeyRecord.
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyRecord

public KeyRecord(Key key,
                 java.lang.String ownerName,
                 java.lang.String ownerMail,
                 java.lang.String notes)
Create a new KeyRecord. It contains key which supposedly belongs to ownerName who has e-mail adress ownerMail. Additional notes are taken from notes.

Method Detail

parseCDS

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

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

Throws:
InvalidCDSException - if the CDS is malformed.
See Also:
Crypto.fromString(String)

getKey

public Key getKey()
Return the key from this record.


getOwnerName

public java.lang.String getOwnerName()
Return the name of the key's owner.


getOwnerMail

public java.lang.String getOwnerMail()
Return the e-mail address of the key's owner.


getNotes

public java.lang.String getNotes()
Return the notes about this key.


getFingerprint

public Fingerprint getFingerprint()
Return the SHA1 fingerprint of this KeyRecord. Signing this is equivalent to signing the record.


toString

public java.lang.String toString()
Return a CDS for this KeyRecord.