public class MLDSACompositeSecretBCPGKey extends OctetArrayBCPGKey
PublicKeyAlgorithmTags.MLDSA65_Ed25519
and PublicKeyAlgorithmTags.MLDSA87_Ed448 (RFC 9980 sec. 5.3.2.2): the fixed-length EdDSA secret key
in the RFC 8032 encoding of its curve, followed by the 32 octet ML-DSA secret key in seed format - the value
xi of FIPS 204 ML-DSA.KeyGen, from which the signing key is expanded with ML-DSA.KeyGen_internal before use.| Modifier and Type | Field and Description |
|---|---|
static int |
MLDSA_SEED_LENGTH
Length of the ML-DSA secret key in seed format (xi).
|
| Constructor and Description |
|---|
MLDSACompositeSecretBCPGKey(int algorithm,
BCPGInputStream in)
Parse the secret key of the given composite algorithm from the (decrypted) secret key material.
|
MLDSACompositeSecretBCPGKey(int algorithm,
byte[] eddsaSecretKey,
byte[] mldsaSeed)
Construct the secret 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[] |
getEdDSASecretKey()
Return the EdDSA (Ed25519 or Ed448) secret key component.
|
static int |
getEdDSASecretKeyLength(int algorithm)
Return the length of the EdDSA secret key component (RFC 9980 Table 6).
|
static int |
getLength(int algorithm)
Return the length of the algorithm-specific secret key material for the given composite algorithm.
|
byte[] |
getMLDSASeed()
Return the ML-DSA seed xi.
|
encode, getEncoded, getFormat, getKeypublic static final int MLDSA_SEED_LENGTH
public MLDSACompositeSecretBCPGKey(int algorithm,
BCPGInputStream in)
throws java.io.IOException
algorithm - public key algorithm ID, PublicKeyAlgorithmTags.MLDSA65_Ed25519 or
PublicKeyAlgorithmTags.MLDSA87_Ed448in - input stream positioned at the algorithm-specific secret key materialjava.io.IOException - if the key cannot be readpublic MLDSACompositeSecretBCPGKey(int algorithm,
byte[] eddsaSecretKey,
byte[] mldsaSeed)
algorithm - public key algorithm ID, PublicKeyAlgorithmTags.MLDSA65_Ed25519 or
PublicKeyAlgorithmTags.MLDSA87_Ed448eddsaSecretKey - the Ed25519 (32 octets) or Ed448 (57 octets) secret keymldsaSeed - the 32 octet ML-DSA seed xipublic int getAlgorithm()
public byte[] getEdDSASecretKey()
public byte[] getMLDSASeed()
public static int getLength(int algorithm)
algorithm - public key algorithm IDpublic static int getEdDSASecretKeyLength(int algorithm)
algorithm - public key algorithm ID