org.apache.commons.openpgp
Class BouncyCastleKeyRing

java.lang.Object
  extended by org.apache.commons.openpgp.BouncyCastleKeyRing
All Implemented Interfaces:
KeyRing

public class BouncyCastleKeyRing
extends Object
implements KeyRing

Bouncy Castle implementation of the OpenPGP key ring.

Author:
Brett Porter

Field Summary
 
Fields inherited from interface org.apache.commons.openpgp.KeyRing
ROLE
 
Constructor Summary
BouncyCastleKeyRing()
           
BouncyCastleKeyRing(InputStream secretKeyRingStream, InputStream publicKeyRingStream, char[] password)
           
 
Method Summary
 void addPublicKeyRing(InputStream publicKeyRingStream)
           
 void addSecretKeyRing(InputStream secretKeyRingStream, char[] password)
           
 String getFirstKeyId()
          Get the key ID of the first secret key that was added to the keyring.
 char[] getPassword()
           
 org.bouncycastle.openpgp.PGPPublicKey getPublicKey(long keyId)
           
 org.bouncycastle.openpgp.PGPPublicKey getPublicKey(String keyId)
           
 org.bouncycastle.openpgp.PGPSecretKey getSecretKey(long keyId)
           
 org.bouncycastle.openpgp.PGPSecretKey getSecretKey(String keyId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BouncyCastleKeyRing

public BouncyCastleKeyRing()

BouncyCastleKeyRing

public BouncyCastleKeyRing(InputStream secretKeyRingStream,
                           InputStream publicKeyRingStream,
                           char[] password)
                    throws IOException,
                           org.bouncycastle.openpgp.PGPException
Throws:
IOException
org.bouncycastle.openpgp.PGPException
Method Detail

addPublicKeyRing

public void addPublicKeyRing(InputStream publicKeyRingStream)
                      throws IOException,
                             org.bouncycastle.openpgp.PGPException
Specified by:
addPublicKeyRing in interface KeyRing
Throws:
IOException
org.bouncycastle.openpgp.PGPException

addSecretKeyRing

public void addSecretKeyRing(InputStream secretKeyRingStream,
                             char[] password)
                      throws IOException,
                             org.bouncycastle.openpgp.PGPException
Throws:
IOException
org.bouncycastle.openpgp.PGPException

getFirstKeyId

public String getFirstKeyId()
Description copied from interface: KeyRing
Get the key ID of the first secret key that was added to the keyring.

Specified by:
getFirstKeyId in interface KeyRing

getPassword

public char[] getPassword()
Specified by:
getPassword in interface KeyRing
Returns:

getSecretKey

public org.bouncycastle.openpgp.PGPSecretKey getSecretKey(String keyId)
Specified by:
getSecretKey in interface KeyRing
Returns:

getPublicKey

public org.bouncycastle.openpgp.PGPPublicKey getPublicKey(String keyId)
Specified by:
getPublicKey in interface KeyRing
Returns:

getSecretKey

public org.bouncycastle.openpgp.PGPSecretKey getSecretKey(long keyId)
Specified by:
getSecretKey in interface KeyRing
Returns:

getPublicKey

public org.bouncycastle.openpgp.PGPPublicKey getPublicKey(long keyId)
Specified by:
getPublicKey in interface KeyRing
Returns:


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.