|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.logi.crypto.Crypto
org.logi.crypto.keys.KeyRing
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.
Key
,
KeyRecord
Field Summary |
Fields inherited from class org.logi.crypto.Crypto |
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO |
Constructor Summary | |
KeyRing()
Create empty key ring. |
Method Summary | |
KeyRecord |
byFingerprint(Fingerprint fingerprint)
Retreive the key with the given fingerprint. |
void |
insert(Key k)
Insert the Key k into the KeyRing. |
void |
insert(KeyRecord kc)
Insert the KeyRecord k into the KeyRing. |
static KeyRing |
parseCDS(java.lang.String arg)
If "KeyRing( key )" is a valid CDS for a KeyRing, then KeyRing.parseCDS(key) will return the described KeyRing object. |
java.lang.String |
toString()
Return a CDS for this KeyRing. |
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 |
public KeyRing()
Method Detail |
public static KeyRing parseCDS(java.lang.String arg) throws InvalidCDSException
A valid CDS can be created by calling the KeyRing.toString() method.
InvalidCDSException
- if the CDS is malformed.Crypto.fromString(String)
public java.lang.String toString()
public void insert(Key k)
k
into the KeyRing. It will be wrapped in
a KeyRecord containing empty strings and no certificates.
public void insert(KeyRecord kc)
k
into the KeyRing.
public KeyRecord byFingerprint(Fingerprint fingerprint)
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.
byFingerprint
in interface KeySource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |