Class BcPGPKeyConverter
java.lang.Object
org.bouncycastle.openpgp.operator.PGPKeyConverter
org.bouncycastle.openpgp.operator.bc.BcPGPKeyConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.crypto.params.MLDSAParametersgetMLDSAParameters(int algorithm) Return the ML-DSA parameter set of an RFC 9980 ML-DSA + EdDSA composite algorithm.static org.bouncycastle.crypto.params.MLKEMParametersgetMLKEMParameters(int algorithm) Return the ML-KEM parameter set of an RFC 9980 ML-KEM + ECDH composite algorithm.getPGPPrivateKey(PGPPublicKey pubKey, org.bouncycastle.crypto.params.AsymmetricKeyParameter privKey) getPGPPublicKey(int version, int algorithm, PGPAlgorithmParameters algorithmParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter pubKey, Date time) Create a PGPPublicKey from the passed in JCA one.getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter pubKey, Date time) Deprecated.org.bouncycastle.crypto.params.AsymmetricKeyParametergetPrivateKey(PGPPrivateKey privKey) org.bouncycastle.crypto.params.AsymmetricKeyParametergetPublicKey(PGPPublicKey publicKey) static org.bouncycastle.crypto.params.SLHDSAParametersgetSLHDSAParameters(int algorithm) Return the SLH-DSA parameter set of an RFC 9980 SLH-DSA algorithm.Methods inherited from class PGPKeyConverter
getPrivateKeyInfo, getPrivateKeyInfo, implGetKdfParameters
-
Constructor Details
-
BcPGPKeyConverter
public BcPGPKeyConverter()
-
-
Method Details
-
getPGPPrivateKey
public PGPPrivateKey getPGPPrivateKey(PGPPublicKey pubKey, org.bouncycastle.crypto.params.AsymmetricKeyParameter privKey) throws PGPException - Throws:
PGPException
-
getPGPPublicKey
@Deprecated public PGPPublicKey getPGPPublicKey(int algorithm, PGPAlgorithmParameters algorithmParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter pubKey, Date time) throws PGPException Deprecated.use versionedgetPGPPublicKey(int, int, PGPAlgorithmParameters, AsymmetricKeyParameter, Date)insteadCreate 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, PGPAlgorithmParameters algorithmParameters, org.bouncycastle.crypto.params.AsymmetricKeyParameter 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
public org.bouncycastle.crypto.params.AsymmetricKeyParameter getPrivateKey(PGPPrivateKey privKey) throws PGPException - Throws:
PGPException
-
getPublicKey
public org.bouncycastle.crypto.params.AsymmetricKeyParameter getPublicKey(PGPPublicKey publicKey) throws PGPException - Throws:
PGPException
-
getMLDSAParameters
public static org.bouncycastle.crypto.params.MLDSAParameters getMLDSAParameters(int algorithm) Return the ML-DSA parameter set of an RFC 9980 ML-DSA + EdDSA composite algorithm.- Parameters:
algorithm-PublicKeyAlgorithmTags.MLDSA65_Ed25519orPublicKeyAlgorithmTags.MLDSA87_Ed448- Returns:
- ML-DSA-65 or ML-DSA-87
-
getSLHDSAParameters
public static org.bouncycastle.crypto.params.SLHDSAParameters getSLHDSAParameters(int algorithm) Return the SLH-DSA parameter set of an RFC 9980 SLH-DSA algorithm.- Parameters:
algorithm- one of the SLH-DSA code points- Returns:
- SLH-DSA-SHAKE-128s, -128f or -256s
-
getMLKEMParameters
public static org.bouncycastle.crypto.params.MLKEMParameters getMLKEMParameters(int algorithm) Return the ML-KEM parameter set of an RFC 9980 ML-KEM + ECDH composite algorithm.- Parameters:
algorithm-PublicKeyAlgorithmTags.MLKEM768_X25519orPublicKeyAlgorithmTags.MLKEM1024_X448- Returns:
- ML-KEM-768 or ML-KEM-1024
-
getPGPPublicKey(int, int, PGPAlgorithmParameters, AsymmetricKeyParameter, Date)instead