Bouncy Castle Cryptography 1.25

org.bouncycastle.openpgp
Class PGPSecretKey

java.lang.Object
  |
  +--org.bouncycastle.openpgp.PGPSecretKey

public class PGPSecretKey
extends java.lang.Object

general class to handle a PGP secret key object.


Constructor Summary
PGPSecretKey(int certificationLevel, int algorithm, java.security.PublicKey pubKey, java.security.PrivateKey privKey, java.util.Date time, java.lang.String id, int encAlgorithm, char[] passPhrase, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, java.security.SecureRandom rand, java.lang.String provider)
           
PGPSecretKey(int certificationLevel, PGPKeyPair keyPair, java.lang.String id, int encAlgorithm, char[] passPhrase, PGPSignatureSubpacketVector hashedPcks, PGPSignatureSubpacketVector unhashedPcks, java.security.SecureRandom rand, java.lang.String provider)
           
 
Method Summary
 void encode(java.io.OutputStream outStream)
           
 PGPPrivateKey extractPrivateKey(char[] passPhrase, java.lang.String provider)
          Extract a PGPPrivate key from the SecretKey's encrypted contents.
 byte[] getEncoded()
           
 long getKeyID()
          Return the keyID associated with this key.
 PGPPublicKey getPublicKey()
          Return the public key associated with this key.
 java.util.Iterator getUserAttributes()
          Return any user attribute vectors associated with the key.
 java.util.Iterator getUserIDs()
          Return any userIDs associated with the key.
 boolean isMasterKey()
          Return true if this is a master key.
 boolean isSigningKey()
          return true if this key is marked as suitable for signature generation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPSecretKey

public PGPSecretKey(int certificationLevel,
                    PGPKeyPair keyPair,
                    java.lang.String id,
                    int encAlgorithm,
                    char[] passPhrase,
                    PGPSignatureSubpacketVector hashedPcks,
                    PGPSignatureSubpacketVector unhashedPcks,
                    java.security.SecureRandom rand,
                    java.lang.String provider)
             throws PGPException,
                    java.security.NoSuchProviderException

PGPSecretKey

public PGPSecretKey(int certificationLevel,
                    int algorithm,
                    java.security.PublicKey pubKey,
                    java.security.PrivateKey privKey,
                    java.util.Date time,
                    java.lang.String id,
                    int encAlgorithm,
                    char[] passPhrase,
                    PGPSignatureSubpacketVector hashedPcks,
                    PGPSignatureSubpacketVector unhashedPcks,
                    java.security.SecureRandom rand,
                    java.lang.String provider)
             throws PGPException,
                    java.security.NoSuchProviderException
Method Detail

isSigningKey

public boolean isSigningKey()
return true if this key is marked as suitable for signature generation.

isMasterKey

public boolean isMasterKey()
Return true if this is a master key.
Returns:
true if a master key.

getKeyID

public long getKeyID()
Return the keyID associated with this key.
Returns:
long

getPublicKey

public PGPPublicKey getPublicKey()
Return the public key associated with this key.
Returns:
PGPPublicKey

getUserIDs

public java.util.Iterator getUserIDs()
Return any userIDs associated with the key.
Returns:
an iterator of Strings.

getUserAttributes

public java.util.Iterator getUserAttributes()
Return any user attribute vectors associated with the key.
Returns:
an iterator of Strings.

extractPrivateKey

public PGPPrivateKey extractPrivateKey(char[] passPhrase,
                                       java.lang.String provider)
                                throws PGPException,
                                       java.security.NoSuchProviderException
Extract a PGPPrivate key from the SecretKey's encrypted contents.
Parameters:
passPhrase -  
provider -  
Returns:
PGPPrivateKey
Throws:
PGPException -  
java.security.NoSuchProviderException -  

getEncoded

public byte[] getEncoded()
                  throws java.io.IOException

encode

public void encode(java.io.OutputStream outStream)
            throws java.io.IOException

Bouncy Castle Cryptography 1.25