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.
-
ident
-
-
Keyring(String)
- Construct with user supplied keyring.
-
getPrivateKey(String)
- Return the private key with the given key name.
-
getPrivateKey(String, String)
- Return a private key generated for a specific provider.
-
getPublicKey(String)
- Return the public key with the given key name.
-
getPublicKey(String, String)
- Return a public key generated for a specific provider.
-
main(String[])
- Display a key in the given keyring as a dotted hexadecimal string
as per the AsciiEncodedKeySpec.
-
readPublicKey(String)
- Read a public key certificate.
-
readSecretKey(String)
- Read a private key.
ident
public static final String ident
Keyring
public Keyring(String keyring)
- Construct with user supplied keyring.
getPublicKey
public PublicKey getPublicKey(String key) throws KeyException, IOException
- Return the public key with the given key name.
- Parameters:
- key - the name of the key we want.
- Returns:
- the PrivateKey object representing that key.
- Throws: KeyException
- a problem occured reading the key.
getPrivateKey
public PrivateKey getPrivateKey(String key) throws KeyException, IOException
- Return the private key with the given key name.
- Parameters:
- key - the name of the key we want.
- Returns:
- the PrivateKey object representing that key.
- Throws: KeyException
- a problem occured reading the key.
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.
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.
readPublicKey
public PublicKeyCertificatePacket readPublicKey(String key) throws IOException
- Read a public key certificate.
readSecretKey
public SecretKeyCertificatePacket readSecretKey(String key) throws IOException
- Read a private key.
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