Class cryptix.pgp.KeyGlob
All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.pgp.KeyGlob
java.lang.Object
|
+----cryptix.pgp.KeyStore
|
+----cryptix.pgp.KeyGlob
- public final class KeyGlob
- extends KeyStore
Stores all of the key sources known to a program -
all public and secret keyrings, and a Web master keyserver.
If setKeyServer is not used, the object will not use one.
Can be passed to objects which decrypt and verify PGP messages
such as ArmouredMessage.
NB Keyrings are searched in the order in which they are added.
Therefore, always add the most highly trusted keyrings first.
The master keyserver is only consulted if a key is not available locally.
Copyright © 1995, 1996, 1997
Systemics Ltd
on behalf of the
Cryptix Development Team.
All rights reserved.
- Author:
- Ian Brown, Jill Baker
-
KeyGlob()
- Initialise an empty KeyGlob
Use addKeyRing and setKeyServer to fill it up
-
addKeyRing(PublicKeyRing)
- Add publicKeyRing to the KeyGlob's collection
-
addKeyRing(SecretKeyRing)
- Add secretKeyRing to the KeyGlob's collection.
-
getKey(EmailAddress)
- Try and find a public key for address
-
getKey(KeyID)
- Try and find a public key for id.
-
getKey(String)
- Try and find a public key for name.
-
getKeyTrust(KeyID, boolean)
- Get the trust value for a given key ID
-
getSecretKey(KeyID, Passphrase)
- Try and find a secret key for id and decrypt it with passphrase
-
getSecretKey(String, Passphrase)
- Try and find a secret key for name and decrypt it with passphrase
-
getUserName(KeyID)
- Returns the name of a user whose key has ID keyID.
Only checks local keyrings.
-
setKeyServer(KeyClient)
- Give KeyGlob keyclient object it can use to fetch keys remotely.
KeyGlob
public KeyGlob()
- Initialise an empty KeyGlob
Use addKeyRing and setKeyServer to fill it up
addKeyRing
public void addKeyRing(PublicKeyRing publicKeyRing)
- Add publicKeyRing to the KeyGlob's collection
addKeyRing
public void addKeyRing(SecretKeyRing secretKeyRing)
- Add secretKeyRing to the KeyGlob's collection.
By allowing more than one secret keyring, users can keep a standard secret key available,
and have a high-security key stored on a floppy disk which applications only access
transparently through this class when it's needed.
setKeyServer
public void setKeyServer(KeyClient client) throws IOException, UnknownHostException
- Give KeyGlob keyclient object it can use to fetch keys remotely.
This will be searched for public keys if they are not available locally.
- Parameters:
- client - An instantiated KeyClient subclass object.
getKeyTrust
public int getKeyTrust(KeyID keyID,
boolean publicRings)
- Get the trust value for a given key ID
- Parameters:
- keyID - the key ID you are interested in
- publicRings - search public rings (true), or secret rings (false)
- Returns:
- trust value, or -1 if key not present
getKey
public PublicKey getKey(String name) throws IOException
- Try and find a public key for name.
- Parameters:
- name - The e-mail address of the user
- Returns:
- Their public key, or null if one can't be found
- Overrides:
- getKey in class KeyStore
getKey
public PublicKey getKey(KeyID id) throws IOException
- Try and find a public key for id.
- Parameters:
- name - The key ID of the user (the low 8 bits of their key pair's public modulus)
- Returns:
- Their public key, or null if one can't be found
- Overrides:
- getKey in class KeyStore
getKey
public final PublicKey getKey(EmailAddress address) throws IOException
- Try and find a public key for address
- Parameters:
- address - The e-mail address of the user
- Returns:
- Their public key, or null if one can't be found
getSecretKey
public SecretKey getSecretKey(String name,
Passphrase passphrase) throws IOException, DecryptException
- Try and find a secret key for name and decrypt it with passphrase
- Parameters:
- name - The e-mail address of the user
- passphrase - The passphrase protecting their secret key
- Returns:
- Their secret key, or null if one can't be found
getSecretKey
public SecretKey getSecretKey(KeyID id,
Passphrase passphrase) throws IOException, DecryptException
- Try and find a secret key for id and decrypt it with passphrase
- Parameters:
- name - The key ID of the user's key
- passphrase - The passphrase protecting their secret key
- Returns:
- Their secret key, or null if one can't be found
getUserName
public final String getUserName(KeyID keyID)
- Returns the name of a user whose key has ID keyID.
Only checks local keyrings.
All Packages Class Hierarchy This Package Previous Next Index