Cryptix OpenPGP

cryptix.openpgp
Class PGPKeyBundle

java.lang.Object
  extended bycryptix.pki.KeyBundle
      extended bycryptix.openpgp.PGPKeyBundle

public abstract class PGPKeyBundle
extends KeyBundle

An OpenPGP KeyBundle.

Version:
$Revision: 1.4 $
Author:
Edwin Woudt , Ingo Luetkebohle

Constructor Summary
protected PGPKeyBundle(java.lang.String type)
          Create a new KeyBundle object with the given type.
 
Method Summary
abstract  boolean addPrivateSubKey(java.security.PrivateKey privsubkey, java.security.PublicKey pubsubkey)
          Adds a private subkey to the keybundle, without encrypting it.
abstract  boolean addPrivateSubKey(java.security.PrivateKey privsubkey, java.security.PublicKey pubsubkey, char[] passphrase, java.security.SecureRandom sr)
          Adds a private subkey to the keybundle, encrypting it with the given passphrase.
abstract  boolean addPublicSubKey(java.security.PublicKey pubsubkey, KeyBundle other)
          Adds a subkey to a keybundle (borrows binding signature from another keybundle).
abstract  boolean addPublicSubKey(java.security.PublicKey subkey, java.security.PrivateKey signkey)
          Adds a public subkey to a keybundle, calculating binding signature.
abstract  boolean containsPrivateKey()
          Returns whether this KeyBundle contains a Private Key.
abstract  java.util.Date getExpirationDate()
          Returns the expiration date, or null of the keybundle does not expire Note: this method assumes that all self signed certificates in this keybundle are correctly signed and not revoked.
abstract  java.security.PrivateKey getPrivateSubKey(java.security.PublicKey pubsubkey, char[] passphrase)
          Return the private key corresponding to the given public key, decrypting it with the given passphrase.
abstract  java.util.Iterator getPublicSubKeys()
          Returns an iterator over all subkeys contained within this bundle The objects returned by the iterator will all be instances of cryptix.openpgp.PGPPublicKey
abstract  boolean isLegacy()
          Returns whether this is a keybundle containing a legacy key
abstract  boolean removePrivateSubKey(java.security.PublicKey pubsubkey)
          Removes the private subkey corresponding to the given public subkey.
abstract  boolean removePublicSubKey(java.security.PublicKey pubsubkey)
          Removes a public subkey.
 
Methods inherited from class cryptix.pki.KeyBundle
addCertificate, addPrincipal, addPrivateKey, addPrivateKey, addPublicKey, clone, equals, getCertificates, getCertificates, getEncoded, getPrincipals, getPrivateKey, getPublicKeys, getType, hashCode, removeCertificate, removePrincipal, removePrivateKey, removePublicKey
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPKeyBundle

protected PGPKeyBundle(java.lang.String type)
Create a new KeyBundle object with the given type.

Method Detail

containsPrivateKey

public abstract boolean containsPrivateKey()
Returns whether this KeyBundle contains a Private Key.


addPublicSubKey

public abstract boolean addPublicSubKey(java.security.PublicKey subkey,
                                        java.security.PrivateKey signkey)
                                 throws KeyBundleException
Adds a public subkey to a keybundle, calculating binding signature.

Throws:
KeyBundleException

addPublicSubKey

public abstract boolean addPublicSubKey(java.security.PublicKey pubsubkey,
                                        KeyBundle other)
                                 throws KeyBundleException
Adds a subkey to a keybundle (borrows binding signature from another keybundle).

Throws:
KeyBundleException

addPrivateSubKey

public abstract boolean addPrivateSubKey(java.security.PrivateKey privsubkey,
                                         java.security.PublicKey pubsubkey,
                                         char[] passphrase,
                                         java.security.SecureRandom sr)
                                  throws KeyBundleException
Adds a private subkey to the keybundle, encrypting it with the given passphrase.

Throws:
KeyBundleException

addPrivateSubKey

public abstract boolean addPrivateSubKey(java.security.PrivateKey privsubkey,
                                         java.security.PublicKey pubsubkey)
                                  throws KeyBundleException
Adds a private subkey to the keybundle, without encrypting it.

Throws:
KeyBundleException

removePublicSubKey

public abstract boolean removePublicSubKey(java.security.PublicKey pubsubkey)
                                    throws KeyBundleException
Removes a public subkey.

Throws:
KeyBundleException

removePrivateSubKey

public abstract boolean removePrivateSubKey(java.security.PublicKey pubsubkey)
                                     throws KeyBundleException
Removes the private subkey corresponding to the given public subkey.

Throws:
KeyBundleException

getPublicSubKeys

public abstract java.util.Iterator getPublicSubKeys()
Returns an iterator over all subkeys contained within this bundle

The objects returned by the iterator will all be instances of cryptix.openpgp.PGPPublicKey


getPrivateSubKey

public abstract java.security.PrivateKey getPrivateSubKey(java.security.PublicKey pubsubkey,
                                                          char[] passphrase)
                                                   throws java.security.UnrecoverableKeyException
Return the private key corresponding to the given public key, decrypting it with the given passphrase.

Returns null if no private key is available

Throws:
java.security.UnrecoverableKeyException

getExpirationDate

public abstract java.util.Date getExpirationDate()
                                          throws KeyBundleException
Returns the expiration date, or null of the keybundle does not expire

Note: this method assumes that all self signed certificates in this keybundle are correctly signed and not revoked. It does not verify this. When getting a key from an untrusted source, these should thus be checked first.

Throws:
KeyBundleException

isLegacy

public abstract boolean isLegacy()
Returns whether this is a keybundle containing a legacy key


Cryptix OpenPGP

Copyright (C) 1999-2003 The Cryptix Foundation Ltd.