Class BcPGPCompositeKeyParameters
java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.openpgp.operator.bc.BcPGPCompositeKeyParameters
- All Implemented Interfaces:
org.bouncycastle.crypto.CipherParameters
public class BcPGPCompositeKeyParameters
extends org.bouncycastle.crypto.params.AsymmetricKeyParameter
Lightweight representation of a composite OpenPGP key of RFC 9980: the two independent component keys of
an ML-DSA + EdDSA signing key (
PublicKeyAlgorithmTags.MLDSA65_Ed25519,
PublicKeyAlgorithmTags.MLDSA87_Ed448) or of an ML-KEM + ECDH encryption key
(PublicKeyAlgorithmTags.MLKEM768_X25519,
PublicKeyAlgorithmTags.MLKEM1024_X448).
BcPGPKeyConverter returns an instance of this class for such keys and expects one when asked to
build the OpenPGP key packets, and BcPGPKeyPair takes an AsymmetricCipherKeyPair
whose halves are instances of it. The traditional component is an
Ed25519PublicKeyParameters / Ed448PublicKeyParameters
or X25519PublicKeyParameters / X448PublicKeyParameters
(or the private key counterpart); the post-quantum component is an
MLDSAPublicKeyParameters or MLKEMPublicKeyParameters
(or the private key counterpart).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBcPGPCompositeKeyParameters(boolean isPrivate, org.bouncycastle.crypto.params.AsymmetricKeyParameter traditionalKey, org.bouncycastle.crypto.params.AsymmetricKeyParameter postQuantumKey) Combine the two component keys of a composite key. -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.crypto.params.AsymmetricKeyParameterReturn the post-quantum (ML-DSA or ML-KEM) component key.org.bouncycastle.crypto.params.AsymmetricKeyParameterReturn the traditional (EdDSA or ECDH) component key.Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
Constructor Details
-
BcPGPCompositeKeyParameters
public BcPGPCompositeKeyParameters(boolean isPrivate, org.bouncycastle.crypto.params.AsymmetricKeyParameter traditionalKey, org.bouncycastle.crypto.params.AsymmetricKeyParameter postQuantumKey) Combine the two component keys of a composite key.- Parameters:
isPrivate- true if both components are private keys, false if both are public keystraditionalKey- the EdDSA or ECDH componentpostQuantumKey- the ML-DSA or ML-KEM component
-
-
Method Details
-
getTraditionalKey
public org.bouncycastle.crypto.params.AsymmetricKeyParameter getTraditionalKey()Return the traditional (EdDSA or ECDH) component key.- Returns:
- traditional component
-
getPostQuantumKey
public org.bouncycastle.crypto.params.AsymmetricKeyParameter getPostQuantumKey()Return the post-quantum (ML-DSA or ML-KEM) component key.- Returns:
- post-quantum component
-