BcPGPKeyConverter
Date: 2016-06-23

org.bouncycastle.openpgp.operator.bc

## Class BcPGPKeyConverter

- java.lang.Object
- - org.bouncycastle.openpgp.operator.bc.BcPGPKeyConverter

-     public class BcPGPKeyConverter
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BcPGPKeyConverter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PGPPrivateKey` | `getPGPPrivateKey(PGPPublicKey pubKey, org.bouncycastle.crypto.params.AsymmetricKeyParameter privKey)`
    `PGPPublicKey` | `getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter pubKey, java.util.Date time)` Create a PGPPublicKey from the passed in JCA one.
    `org.bouncycastle.crypto.params.AsymmetricKeyParameter` | `getPrivateKey(PGPPrivateKey privKey)`
    `org.bouncycastle.crypto.params.AsymmetricKeyParameter` | `getPublicKey(PGPPublicKey publicKey)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BcPGPKeyConverter

          public BcPGPKeyConverter()

  - ### Method Detail

    - #### getPGPPublicKey

          public PGPPublicKey getPGPPublicKey(int algorithm,
                                     PGPAlgorithmParameters algorithmParameters,
                                     org.bouncycastle.crypto.params.AsymmetricKeyParameter 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:
        `algorithm` - asymmetric algorithm type representing the public key.
        `pubKey` - actual public key to associate.
        `time` - date of creation.
      Throws:
        `PGPException` - on key creation problem.

    - #### getPGPPrivateKey

          public PGPPrivateKey getPGPPrivateKey(PGPPublicKey pubKey,
                                       org.bouncycastle.crypto.params.AsymmetricKeyParameter privKey)
                                         throws PGPException

      Throws:
        `PGPException`

    - #### getPublicKey

          public org.bouncycastle.crypto.params.AsymmetricKeyParameter getPublicKey(PGPPublicKey publicKey)
                                                                             throws PGPException

      Throws:
        `PGPException`

    - #### getPrivateKey

          public org.bouncycastle.crypto.params.AsymmetricKeyParameter getPrivateKey(PGPPrivateKey privKey)
                                                                              throws PGPException

      Throws:
        `PGPException`