public class MLDSACompositePublicBCPGKey extends OctetArrayBCPGKey
PublicKeyAlgorithmTags.MLDSA65_Ed25519
and PublicKeyAlgorithmTags.MLDSA87_Ed448 (RFC 9980 sec. 5.3.2.1): the fixed-length EdDSA public key
in the RFC 8032 encoding of its curve, followed by the fixed-length ML-DSA public key in the FIPS 204 encoding.
The component lengths are fixed by the algorithm ID (RFC 9980 Tables 6 and 7), so the key knows which
algorithm it belongs to and the two components can be read back with getEdDSAPublicKey() and
getMLDSAPublicKey().
| Constructor and Description |
|---|
MLDSACompositePublicBCPGKey(int algorithm,
BCPGInputStream in)
Parse the public key of the given composite algorithm from the packet stream.
|
MLDSACompositePublicBCPGKey(int algorithm,
byte[] eddsaPublicKey,
byte[] mldsaPublicKey)
Construct the public key of the given composite algorithm from its two components.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAlgorithm()
Return the public key algorithm ID this key belongs to.
|
byte[] |
getEdDSAPublicKey()
Return the EdDSA (Ed25519 or Ed448) public key component.
|
static int |
getEdDSAPublicKeyLength(int algorithm)
Return the length of the EdDSA public key component (RFC 9980 Table 6).
|
static int |
getEdDSASignatureLength(int algorithm)
Return the length of the EdDSA signature component of a composite signature (RFC 9980 Table 6).
|
static int |
getLength(int algorithm)
Return the length of the algorithm-specific public key material for the given composite algorithm.
|
byte[] |
getMLDSAPublicKey()
Return the ML-DSA public key component.
|
static int |
getMLDSAPublicKeyLength(int algorithm)
Return the length of the ML-DSA public key component (RFC 9980 Table 7).
|
static int |
getMLDSASignatureLength(int algorithm)
Return the length of the ML-DSA signature component of a composite signature (RFC 9980 Table 7).
|
static int |
getSignatureLength(int algorithm)
Return the total length of a composite signature: the EdDSA signature followed by the ML-DSA signature
(RFC 9980 sec. 5.3.1).
|
encode, getEncoded, getFormat, getKeypublic MLDSACompositePublicBCPGKey(int algorithm,
BCPGInputStream in)
throws java.io.IOException
algorithm - public key algorithm ID, PublicKeyAlgorithmTags.MLDSA65_Ed25519 or
PublicKeyAlgorithmTags.MLDSA87_Ed448in - packet input stream positioned at the algorithm-specific key materialjava.io.IOException - if the key cannot be readpublic MLDSACompositePublicBCPGKey(int algorithm,
byte[] eddsaPublicKey,
byte[] mldsaPublicKey)
algorithm - public key algorithm ID, PublicKeyAlgorithmTags.MLDSA65_Ed25519 or
PublicKeyAlgorithmTags.MLDSA87_Ed448eddsaPublicKey - the Ed25519 (32 octets) or Ed448 (57 octets) public keymldsaPublicKey - the ML-DSA-65 (1952 octets) or ML-DSA-87 (2592 octets) public keypublic int getAlgorithm()
public byte[] getEdDSAPublicKey()
public byte[] getMLDSAPublicKey()
public static int getLength(int algorithm)
algorithm - public key algorithm IDpublic static int getEdDSAPublicKeyLength(int algorithm)
algorithm - public key algorithm IDpublic static int getMLDSAPublicKeyLength(int algorithm)
algorithm - public key algorithm IDpublic static int getEdDSASignatureLength(int algorithm)
algorithm - public key algorithm IDpublic static int getMLDSASignatureLength(int algorithm)
algorithm - public key algorithm IDpublic static int getSignatureLength(int algorithm)
algorithm - public key algorithm ID