Class au.net.aba.pgp.Keyring
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.pgp.Keyring

java.lang.Object
   |
   +----au.net.aba.pgp.Keyring

public class Keyring
extends Object
A PGP keyring. To use this package in conjunction with the ABA crypto provider it is necessary to use a PGP 2.3 compatible keyring, with no passphrase on the keyring.

In your application:

import au.net.aba.pgp.Keyring;
Keyring keyRing = new Keyring(keyringdir);
PublicKey publicKey = keyRing.getPublicKey(keyID);

Where keyringdir is directory containing the pgp pubring.pgp and secring.pgp files and keyID is the keyname to be retrieved.


Variable Index

 o ident

Constructor Index

 o Keyring(String)
Construct with user supplied keyring.

Method Index

 o getPrivateKey(String)
Return a private key.
 o getPrivateKey(String, String)
return a private key generated for a specific provider.
 o getPublicKey(String)
Return a public key.
 o getPublicKey(String, String)
return a public key generated for a specific provider.
 o main(String[])
Display a key in the given keyring as a dotted hexadecimal string as per the AsciiEncodedKeySpec.
 o readPublicKey(String)
Read a public key certificate.
 o readSecretKey(String)
Read a private key.

Variables

 o ident
  public final static String ident

Constructors

 o Keyring
  public Keyring(String keyring)
Construct with user supplied keyring.

Methods

 o getPublicKey
  public PublicKey getPublicKey(String key) throws KeyException, IOException
Return a public key.
Parameters:
key - the name of the key we want
Returns:
the PrivateKey object representing that key.
Throws: KeyException
a problem occured reading the key.
 o getPrivateKey
  public PrivateKey getPrivateKey(String key) throws KeyException, IOException
Return a private key.
Parameters:
key - the name of the key we want
Returns:
the PrivateKey object representing that key.
Throws: KeyException
a problem occured reading the key.
 o getPublicKey
  public PublicKey getPublicKey(String key,
                                String provider) throws KeyException, IOException
return a public key generated for a specific provider.
Parameters:
key - the name of the key we want.
provider - the name of the provider we want to use.
Returns:
the PrivateKey object representing that key.
Throws: KeyException
a problem occured reading the key.
 o getPrivateKey
  public PrivateKey getPrivateKey(String key,
                                  String provider) throws KeyException, IOException
return a private key generated for a specific provider.
Parameters:
key - the name of the key we want.
provider - the name of the provider we want to use.
Returns:
the PrivateKey object representing that key.
Throws: KeyException
a problem occured reading the key.
 o readPublicKey
  public PublicKeyCertificatePacket readPublicKey(String key) throws IOException
Read a public key certificate.
 o readSecretKey
  public SecretKeyCertificatePacket readSecretKey(String key) throws IOException
Read a private key.
 o main
  public static void main(String arg[]) throws IOException
Display a key in the given keyring as a dotted hexadecimal string as per the AsciiEncodedKeySpec.

All Packages  Class Hierarchy  This Package  Previous  Next  Index