All Packages Class Hierarchy This Package Previous Next Index
Class IS.hi.logir.cryptonite.KeyRing
java.lang.Object
|
+----IS.hi.logir.cryptonite.KeyRing
- public final class KeyRing
- extends Object
- implements Serializable
This class holds a collection of public keys the user has collected, along with
his private keys.
It contains methods to find keys given the name and/or e-mail address of the owner,
and various key-validation and management routines.
- Author:
- Logi Ragnarsson (logir@hi.is)
- See Also:
- Key, KeyPair
-
lastCheck
-
-
priKeys
-
-
pubKeys
-
-
trustKeys
-
-
KeyRing()
- Create a new empty KeyRing.
-
addPair(Key, Key)
- Add a public/private Key-pair to the KeyRing.
-
addPair(KeyPair)
- Add a public/private Key-pair to the KeyRing.
-
addPub(Key)
- Add a public Key to the KeyRing.
-
addTrusted(Key)
- Add a trusted Key to the KeyRing.
-
addTrustedPair(Key, Key)
- Add a trusted public/private Key-pair to the KeyRing.
-
addTrustedPair(KeyPair)
- Add a trusted public/private Key-pair to the KeyRing.
-
find(String, String, Hashtable)
-
-
findList(String, String, Hashtable)
-
-
findListPri(String, String)
- Find all private keys partially matching a name/e-mail pair.
-
findListPub(String, String)
- Find all public keys partially matching a name/e-mail pair.
-
findPri(String, String)
- Find a private key partially matching a name/e-mail pair.
-
findPub(String, String)
- Find a public key partially matching a name/e-mail pair.
-
getPri(Fingerprint)
- Return the private key with the specified fingerprint.
-
getPub(Fingerprint)
- Return the public key with the specified fingerprint.
-
getTrusted(Fingerprint)
- Return the trusted key with the specified fingerprint.
-
isTrusted(Key)
- Returns true if a signature with the Key k is accepted as a key validation.
-
isValid(Key)
- Returns true if the Key k has a signature from a trusted party.
-
remove(Key)
- Remove a key from the KeyRing.
-
testFingerprints()
-
lastCheck
private transient Date lastCheck
pubKeys
private Hashtable pubKeys
trustKeys
private Hashtable trustKeys
priKeys
private Hashtable priKeys
KeyRing
public KeyRing()
- Create a new empty KeyRing.
addPub
public void addPub(Key k)
- Add a public Key to the KeyRing.
addTrusted
public void addTrusted(Key k)
- Add a trusted Key to the KeyRing.
addPair
public void addPair(Key pub,
Key pri)
- Add a public/private Key-pair to the KeyRing.
addPair
public void addPair(KeyPair kp)
- Add a public/private Key-pair to the KeyRing.
addTrustedPair
public void addTrustedPair(Key pub,
Key pri)
- Add a trusted public/private Key-pair to the KeyRing.
addTrustedPair
public void addTrustedPair(KeyPair kp)
- Add a trusted public/private Key-pair to the KeyRing.
getPub
public Key getPub(Fingerprint fingerprint) throws KeyRingCorruptException
- Return the public key with the specified fingerprint. If it does
not exist, null is returned instead.
getPri
public Key getPri(Fingerprint fingerprint)
- Return the private key with the specified fingerprint. If it does
not exist, null is returned instead.
getTrusted
public Key getTrusted(Fingerprint fingerprint)
- Return the trusted key with the specified fingerprint. If it does
not exist, null is returned instead.
isTrusted
public boolean isTrusted(Key k)
- Returns true if a signature with the Key k is accepted as a key validation.
isValid
public boolean isValid(Key k) throws KeyRingCorruptException
- Returns true if the Key k has a signature from a trusted party. This code is
dependant on the Fingerprint class which has not been implemented.
testFingerprints
private void testFingerprints() throws KeyRingCorruptException
remove
public void remove(Key k)
- Remove a key from the KeyRing.
find
private static Key find(String name,
String mail,
Hashtable keys)
findPub
public Key findPub(String name,
String mail)
- Find a public key partially matching a name/e-mail pair. If name is not null,
then it will be a sub-string of the name of the owner of the key. If mail is
not null, then it will be a sub-string of the e-mail address of the owner of
the key.
If no such key exists, null is returned.
If more than one key mathces the criteria, the first one found is returned.
findPri
public Key findPri(String name,
String mail)
- Find a private key partially matching a name/e-mail pair. If name is not null,
then it will be a sub-string of the name of the owner of the key. If mail is
not null, then it will be a sub-string of the e-mail address of the owner of
the key.
If no such key exists, null is returned.
If more than one key mathces the criteria, the first one found is returned.
findList
private static Key[] findList(String name,
String mail,
Hashtable keys)
findListPub
public Key[] findListPub(String name,
String mail)
- Find all public keys partially matching a name/e-mail pair. If name is not null,
then it will be a sub-string of the name of the owner of the keys. If mail is not
null, then it will be a sub-string of the e-mail address of the owner of the keys.
findListPri
public Key[] findListPri(String name,
String mail)
- Find all private keys partially matching a name/e-mail pair. If name is not null,
then it will be a sub-string of the name of the owner of the keys. If mail is not
null, then it will be a sub-string of the e-mail address of the owner of the keys.
All Packages Class Hierarchy This Package Previous Next Index