Class JcaPGPKeyConverter
java.lang.Object
org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPGPPrivateKey
(PGPPublicKey pub, PrivateKey privKey) Convert a PrivateKey into a PGPPrivateKey.getPGPPublicKey
(int algorithm, PublicKey pubKey, Date time) Create a PGPPublicKey from the passed in JCA one.getPGPPublicKey
(int algorithm, PGPAlgorithmParameters algorithmParameters, PublicKey pubKey, Date time) Create a PGPPublicKey from the passed in JCA one.getPrivateKey
(PGPPrivateKey privKey) getPublicKey
(PGPPublicKey publicKey) setProvider
(String providerName) setProvider
(Provider provider)
-
Constructor Details
-
JcaPGPKeyConverter
public JcaPGPKeyConverter()
-
-
Method Details
-
setProvider
-
setProvider
-
getPGPPrivateKey
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, PublicKey pubKey, 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.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
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.
-
getPrivateKey
- Throws:
PGPException
-
getPublicKey
- Throws:
PGPException
-