<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Crypto.Parameters.MLKemPrivateKeyParameters

An ML-KEM private (decapsulation) key, as specified in FIPS 203.
public enum Format

Representation format for an ML-KEM private key.

public Format PreferredFormat { get; }

The caller-preferred encoding format (see Format).

public static MLKemPrivateKeyParameters FromEncoding(MLKemParameters parameters, byte[] encoding)

Create an MLKemPrivateKeyParameters from its expanded FIPS 203 private key encoding.

public static MLKemPrivateKeyParameters FromSeed(MLKemParameters parameters, byte[] seed)

Derive a private key from its 32-byte seed, defaulting to the SeedOnly representation.

public static MLKemPrivateKeyParameters FromSeed(MLKemParameters parameters, byte[] seed, Format preferredFormat)

Derive a private key from its 32-byte seed, selecting the preferred on-disk representation.

public byte[] GetEncoded()

Returns a copy of the expanded FIPS 203 private key encoding.

Extracts the matching MLKemPublicKeyParameters from this private key.

public byte[] GetPublicKeyEncoded()

Returns the raw public (encapsulation) key bytes embedded in this private key.

public byte[] GetSeed()

Returns a copy of the 32-byte seed, or null if the key was imported without one (i.e. created via FromEncoding).

Returns this key with a different PreferredFormat, or the same instance if no change is needed.