public class JcaPGPKeyConverter
extends java.lang.Object
Constructor and Description |
---|
JcaPGPKeyConverter() |
Modifier and Type | Method and Description |
---|---|
PGPPrivateKey |
getPGPPrivateKey(PGPPublicKey pub,
java.security.PrivateKey privKey)
Convert a PrivateKey into a PGPPrivateKey.
|
PGPPublicKey |
getPGPPublicKey(int algorithm,
PGPAlgorithmParameters algorithmParameters,
java.security.PublicKey pubKey,
java.util.Date time)
Create a PGPPublicKey from the passed in JCA one.
|
PGPPublicKey |
getPGPPublicKey(int algorithm,
java.security.PublicKey pubKey,
java.util.Date time)
Create a PGPPublicKey from the passed in JCA one.
|
java.security.PrivateKey |
getPrivateKey(PGPPrivateKey privKey) |
java.security.PublicKey |
getPublicKey(PGPPublicKey publicKey) |
JcaPGPKeyConverter |
setProvider(java.security.Provider provider) |
JcaPGPKeyConverter |
setProvider(java.lang.String providerName) |
public JcaPGPKeyConverter setProvider(java.security.Provider provider)
public JcaPGPKeyConverter setProvider(java.lang.String providerName)
public PGPPrivateKey getPGPPrivateKey(PGPPublicKey pub, java.security.PrivateKey privKey) throws PGPException
pub
- the corresponding PGPPublicKey to privKey.privKey
- the private key for the key in pub.PGPException
public PGPPublicKey getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, java.security.PublicKey pubKey, java.util.Date time) throws PGPException
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.
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.PGPException
- on key creation problem.public PGPPublicKey getPGPPublicKey(int algorithm, java.security.PublicKey pubKey, java.util.Date time) throws PGPException
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.
algorithm
- asymmetric algorithm type representing the public key.pubKey
- actual public key to associate.time
- date of creation.PGPException
- on key creation problem.public java.security.PrivateKey getPrivateKey(PGPPrivateKey privKey) throws PGPException
PGPException
public java.security.PublicKey getPublicKey(PGPPublicKey publicKey) throws PGPException
PGPException