org.logi.crypto.keys
Class KeyRecord

java.lang.Object
  |
  +--org.logi.crypto.Crypto
        |
        +--org.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.

Author:
Logi Ragnarsson (logir@logi.org)
See Also:
Key, KeySource

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[] param)
          Used by Crypto.fromString when parsing a CDS.
 void prettyPrint(java.io.PrintWriter out, int ind, int rec)
          Print this object to out, indented with ind tabs, going down at most rec levels of recursion.
 java.lang.String toString()
          Return a CDS for this KeyRecord.
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
equals, 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[] param)
                          throws InvalidCDSException
Used by Crypto.fromString when parsing a CDS.

A valid CDS can be created by calling the 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.
Overrides:
toString in class java.lang.Object

prettyPrint

public void prettyPrint(java.io.PrintWriter out,
                        int ind,
                        int rec)
                 throws java.io.IOException
Print this object to out, indented with ind tabs, going down at most rec levels of recursion.
Overrides:
prettyPrint in class Crypto


Copyright (c) 1997-2001 Logi Ragnarsson - Distributed under the GPL