Class JcaPGPKeyConverter
java.lang.Object
org.bouncycastle.openpgp.operator.PGPKeyConverter
org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.asn1.ASN1ObjectIdentifiergetMLDSAOid(int algorithm) Return the object identifier of the ML-DSA parameter set of an RFC 9980 ML-DSA + EdDSA composite algorithm.static org.bouncycastle.asn1.ASN1ObjectIdentifiergetMLKEMOid(int algorithm) Return the object identifier of the ML-KEM parameter set of an RFC 9980 ML-KEM + ECDH composite algorithm.getPGPPrivateKey(PGPPublicKey pub, PrivateKey privKey) Convert a PrivateKey into a PGPPrivateKey.getPGPPublicKey(int version, int algorithm, PublicKey pubKey, Date time) Create a PGPPublicKey from the passed in JCA one.getPGPPublicKey(int version, int algorithm, PGPAlgorithmParameters algorithmParameters, PublicKey pubKey, Date time) Create a PGPPublicKey from the passed in JCA one.getPGPPublicKey(int algorithm, PublicKey pubKey, Date time) Deprecated.getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, PublicKey pubKey, Date time) Deprecated.use versionedgetPGPPublicKey(int, int, PGPAlgorithmParameters, PublicKey, Date)instead.getPrivateKey(PGPPrivateKey privKey) getPublicKey(PGPPublicKey publicKey) static org.bouncycastle.asn1.ASN1ObjectIdentifiergetSLHDSAOid(int algorithm) Return the object identifier of the SLH-DSA parameter set of an RFC 9980 SLH-DSA algorithm.setProvider(String providerName) setProvider(Provider provider) Methods inherited from class PGPKeyConverter
getPrivateKeyInfo, getPrivateKeyInfo, implGetKdfParameters
-
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
@Deprecated public PGPPublicKey getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, PublicKey pubKey, Date time) throws PGPException Deprecated.use versionedgetPGPPublicKey(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, 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:
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
@Deprecated public PGPPublicKey getPGPPublicKey(int algorithm, PublicKey pubKey, Date time) throws PGPException Deprecated.use versionedgetPGPPublicKey(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, 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:
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
- Throws:
PGPException
-
getPublicKey
- Throws:
PGPException
-
getMLDSAOid
public static org.bouncycastle.asn1.ASN1ObjectIdentifier getMLDSAOid(int algorithm) Return the object identifier of the ML-DSA parameter set of an RFC 9980 ML-DSA + EdDSA composite algorithm.- Parameters:
algorithm-PublicKeyAlgorithmTags.MLDSA65_Ed25519orPublicKeyAlgorithmTags.MLDSA87_Ed448- Returns:
- id-ml-dsa-65 or id-ml-dsa-87
-
getSLHDSAOid
public static org.bouncycastle.asn1.ASN1ObjectIdentifier getSLHDSAOid(int algorithm) Return the object identifier of the SLH-DSA parameter set of an RFC 9980 SLH-DSA algorithm.- Parameters:
algorithm- one of the SLH-DSA code points- Returns:
- id-slh-dsa-shake-128s, -128f or -256s
-
getMLKEMOid
public static org.bouncycastle.asn1.ASN1ObjectIdentifier getMLKEMOid(int algorithm) Return the object identifier of the ML-KEM parameter set of an RFC 9980 ML-KEM + ECDH composite algorithm.- Parameters:
algorithm-PublicKeyAlgorithmTags.MLKEM768_X25519orPublicKeyAlgorithmTags.MLKEM1024_X448- Returns:
- id-alg-ml-kem-768 or id-alg-ml-kem-1024
-
getPGPPublicKey(int, int, PublicKey, Date)instead.