|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.pgp.KeyStore | +--cryptix.pgp.KeyGlob
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-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1.1.1 $
Constructor Summary | |
KeyGlob()
Initializes an empty KeyGlob. |
Method Summary | |
void |
addKeyRing(PublicKeyRing publicKeyRing)
Adds publicKeyRing to the KeyGlob's collection. |
void |
addKeyRing(SecretKeyRing secretKeyRing)
Adds secretKeyRing to the KeyGlob's collection. |
PublicKey |
getKey(EmailAddress address)
Tries to find a public key for address. |
PublicKey |
getKey(KeyID id)
Tries to find a public key for id. |
PublicKey |
getKey(java.lang.String name)
Tries to find a public key for name. |
int |
getKeyTrust(KeyID keyID,
boolean publicRings)
Gets the trust value for a given key ID. |
SecretKey |
getSecretKey(KeyID id,
Passphrase passphrase)
Tries to find a secret key for id, and decrypt it with passphrase. |
SecretKey |
getSecretKey(java.lang.String name,
Passphrase passphrase)
Tries to find a secret key for name, and decrypt it with passphrase. |
java.lang.String |
getUserName(KeyID keyID)
Returns the name of a user whose key has ID keyID. |
void |
setKeyServer(KeyClient client)
Gives KeyGlob a keyclient object that it can use to fetch keys remotely. |
Methods inherited from class cryptix.pgp.KeyStore |
checkSignature, checkSignature, checkSignature |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public KeyGlob()
addKeyRing
and
setKeyServer
to fill it up.Method Detail |
public void addKeyRing(PublicKeyRing publicKeyRing)
public void addKeyRing(SecretKeyRing secretKeyRing)
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.
public void setKeyServer(KeyClient client) throws java.io.IOException, java.net.UnknownHostException
client
- an instantiated KeyClient subclass objectjava.io.IOException
- if there was an I/O errorjava.net.UnknownHostException
- if the public key server was unreachablepublic int getKeyTrust(KeyID keyID, boolean publicRings)
keyID
- the key ID you are interested inpublicRings
- search public rings (true), or secret rings (false)public PublicKey getKey(java.lang.String name) throws java.io.IOException
getKey
in class KeyStore
name
- the name of the userjava.io.IOException
- if there was an I/O errorpublic PublicKey getKey(KeyID id) throws java.io.IOException
getKey
in class KeyStore
id
- the key ID of the user (the low 8 bits of their key pair's
public modulus)java.io.IOException
- if there was an I/O errorpublic PublicKey getKey(EmailAddress address) throws java.io.IOException
address
- the e-mail address of the userjava.io.IOException
- if there was an I/O errorpublic SecretKey getSecretKey(java.lang.String name, Passphrase passphrase) throws java.io.IOException, DecryptException
name
- the e-mail address of the userpassphrase
- the passphrase protecting their secret keyjava.io.IOException
- if there was an I/O errorDecryptException
- if the secret key could not be decryptedpublic SecretKey getSecretKey(KeyID id, Passphrase passphrase) throws java.io.IOException, DecryptException
id
- the key ID of the user's keypassphrase
- the passphrase protecting their secret keyjava.io.IOException
- if there was an I/O errorDecryptException
- if the secret key could not be decryptedpublic java.lang.String getUserName(KeyID keyID)
Only checks local keyrings.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |