cryptix.pgp
Class PublicKeyRing

java.lang.Object
  extended bycryptix.pgp.KeyStore
      extended bycryptix.pgp.KeyRing
          extended bycryptix.pgp.PublicKeyRing
Direct Known Subclasses:
KeyCache

public class PublicKeyRing
extends KeyRing

Represents a public keyring. Keys on it can be retrieved using the getKey() functions.

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Since:
Cryptix 2.2 or earlier
Author:
Mike Wynn, Ian Brown

Field Summary
 
Fields inherited from class cryptix.pgp.KeyRing
addresses, entriesById, users
 
Constructor Summary
PublicKeyRing()
          Creates an empty public keyring object.
PublicKeyRing(java.io.InputStream in)
          Creates a new public keyring object from in.
PublicKeyRing(java.lang.String filename)
          Creates a new public keyring object from the file filename.
 
Method Summary
 PublicKey getKey(EmailAddress address)
          Retrieves a key by any of the e-mail addresses on it.
 PublicKey getKey(KeyID keyID)
          Retrieves a key by its ID.
 PublicKey getKey(java.lang.String username)
          Retrieves a key by any of the user names on it.
protected  void init(PacketInputStream reader)
          Subclasses should override this method to read entries from an InputStream.
 
Methods inherited from class cryptix.pgp.KeyRing
add, checkSignatures, checkSignatures, dump, getFullNameList, getFullUserNameList, getIfBegins, getKeyTrust, getPublicKey, getPublicKey, getSecretKey, getSecretKey, getUserName, list, write
 
Methods inherited from class cryptix.pgp.KeyStore
checkSignature, checkSignature, checkSignature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublicKeyRing

public PublicKeyRing()
Creates an empty public keyring object. Use the add method to add new entries.


PublicKeyRing

public PublicKeyRing(java.io.InputStream in)
              throws java.io.IOException
Creates a new public keyring object from in.

Throws:
java.io.IOException - if there was an I/O error

PublicKeyRing

public PublicKeyRing(java.lang.String filename)
              throws java.io.FileNotFoundException,
                     java.io.IOException
Creates a new public keyring object from the file filename.

Throws:
java.io.FileNotFoundException - if filename was not found
java.io.IOException - if there was an I/O error
Method Detail

getKey

public PublicKey getKey(java.lang.String username)
                 throws java.io.IOException
Retrieves a key by any of the user names on it.

Specified by:
getKey in class KeyStore
Throws:
java.io.IOException

getKey

public PublicKey getKey(KeyID keyID)
                 throws java.io.IOException
Retrieves a key by its ID.

Specified by:
getKey in class KeyStore
Throws:
java.io.IOException

getKey

public PublicKey getKey(EmailAddress address)
                 throws java.io.IOException
Retrieves a key by any of the e-mail addresses on it.

Throws:
java.io.IOException

init

protected final void init(PacketInputStream reader)
                   throws java.io.IOException
Description copied from class: KeyRing
Subclasses should override this method to read entries from an InputStream.

Specified by:
init in class KeyRing
Throws:
java.io.IOException