Bouncy Castle Cryptography Library 1.81

org.bouncycastle.openpgp.operator.jcajce
Class JcaPGPKeyConverter

java.lang.Object
  extended byorg.bouncycastle.openpgp.operator.PGPKeyConverter
      extended byorg.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyConverter

public class JcaPGPKeyConverter
extends PGPKeyConverter


Constructor Summary
JcaPGPKeyConverter()
           
 
Method Summary
 PGPPrivateKey getPGPPrivateKey(PGPPublicKey pub, java.security.PrivateKey privKey)
          Convert a PrivateKey into a PGPPrivateKey.
 PGPPublicKey getPGPPublicKey(int version, int algorithm, PGPAlgorithmParameters algorithmParameters, java.security.PublicKey pubKey, java.util.Date time)
          Create a PGPPublicKey from the passed in JCA one.
 PGPPublicKey getPGPPublicKey(int version, int algorithm, java.security.PublicKey pubKey, java.util.Date time)
          Create a PGPPublicKey from the passed in JCA one.
 PGPPublicKey getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, java.security.PublicKey pubKey, java.util.Date time)
          Deprecated. use versioned getPGPPublicKey(int, int, PGPAlgorithmParameters, PublicKey, Date) instead.
 PGPPublicKey getPGPPublicKey(int algorithm, java.security.PublicKey pubKey, java.util.Date time)
          Deprecated. use versioned getPGPPublicKey(int, int, PublicKey, Date) instead.
 java.security.PrivateKey getPrivateKey(PGPPrivateKey privKey)
           
 java.security.PublicKey getPublicKey(PGPPublicKey publicKey)
           
 JcaPGPKeyConverter setProvider(java.security.Provider provider)
           
 JcaPGPKeyConverter setProvider(java.lang.String providerName)
           
 
Methods inherited from class org.bouncycastle.openpgp.operator.PGPKeyConverter
getPrivateKeyInfo, getPrivateKeyInfo, implGetKdfParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcaPGPKeyConverter

public JcaPGPKeyConverter()
Method Detail

setProvider

public JcaPGPKeyConverter setProvider(java.security.Provider provider)

setProvider

public JcaPGPKeyConverter setProvider(java.lang.String providerName)

getPGPPrivateKey

public PGPPrivateKey getPGPPrivateKey(PGPPublicKey pub,
                                      java.security.PrivateKey privKey)
                               throws PGPException
Convert a PrivateKey into a PGPPrivateKey.

Parameters:
pub - the corresponding PGPPublicKey to privKey.
privKey - the private key for the key in pub.
Returns:
a PGPPrivateKey
Throws:
PGPException

getPGPPublicKey

public PGPPublicKey getPGPPublicKey(int algorithm,
                                    PGPAlgorithmParameters algorithmParameters,
                                    java.security.PublicKey pubKey,
                                    java.util.Date time)
                             throws PGPException
Deprecated. use versioned getPGPPublicKey(int, int, PGPAlgorithmParameters, PublicKey, Date) instead.

Create a version 4 PGPPublicKey from the passed in JCA one.

Note: the time passed in affects the value of the key's keyID, so you probably only want to do this once for a JCA key, or make sure you keep track of the time you used.

Parameters:
algorithm - asymmetric algorithm type representing the public key.
algorithmParameters - additional parameters to be stored against the public key.
pubKey - actual public key to associate.
time - date of creation.
Throws:
PGPException - on key creation problem.

getPGPPublicKey

public PGPPublicKey getPGPPublicKey(int version,
                                    int algorithm,
                                    PGPAlgorithmParameters algorithmParameters,
                                    java.security.PublicKey pubKey,
                                    java.util.Date time)
                             throws PGPException
Create a PGPPublicKey from the passed in JCA one.

Note: the time passed in affects the value of the key's keyID, so you probably only want to do this once for a JCA key, or make sure you keep track of the time you used.

Parameters:
version - key version.
algorithm - asymmetric algorithm type representing the public key.
algorithmParameters - additional parameters to be stored against the public key.
pubKey - actual public key to associate.
time - date of creation.
Throws:
PGPException - on key creation problem.

getPGPPublicKey

public PGPPublicKey getPGPPublicKey(int algorithm,
                                    java.security.PublicKey pubKey,
                                    java.util.Date time)
                             throws PGPException
Deprecated. use versioned getPGPPublicKey(int, int, PublicKey, Date) instead.

Create a version 4 PGPPublicKey from the passed in JCA one.

Note: the time passed in affects the value of the key's keyID, so you probably only want to do this once for a JCA key, or make sure you keep track of the time you used.

Parameters:
algorithm - asymmetric algorithm type representing the public key.
pubKey - actual public key to associate.
time - date of creation.
Throws:
PGPException - on key creation problem.

getPGPPublicKey

public PGPPublicKey getPGPPublicKey(int version,
                                    int algorithm,
                                    java.security.PublicKey pubKey,
                                    java.util.Date time)
                             throws PGPException
Create a PGPPublicKey from the passed in JCA one.

Note: the time passed in affects the value of the key's keyID, so you probably only want to do this once for a JCA key, or make sure you keep track of the time you used.

Parameters:
version - key version.
algorithm - asymmetric algorithm type representing the public key.
pubKey - actual public key to associate.
time - date of creation.
Throws:
PGPException - on key creation problem.

getPrivateKey

public java.security.PrivateKey getPrivateKey(PGPPrivateKey privKey)
                                       throws PGPException
Throws:
PGPException

getPublicKey

public java.security.PublicKey getPublicKey(PGPPublicKey publicKey)
                                     throws PGPException
Throws:
PGPException

Bouncy Castle Cryptography Library 1.81