SetSignProcessMLDSAIdentity

Security and signatures

Description

Attaches an ML-DSA certificate and private key to a signing process for post-quantum PDF signatures carried in a CMS container (ISO/TS 32005)

The certificate must be DER encoded with an id-ML-DSA-44, id-ML-DSA-65 or id-ML-DSA-87 subject-public-key algorithm; the parameter set is selected from the certificate automatically. The private key can be a raw 32-byte seed or an unencrypted PKCS #8 v2 value wrapping one, and is validated by re-deriving the public key before use

The signature SubFilter stays on the CMS profiles (adbe.pkcs7.detached or ETSI.CAdES.detached); ISO/TS 32005 defines the ML-DSA algorithms inside the CMS SignerInfo, not a new SubFilter

Syntax

Delphi

Function TPDFlib.SetSignProcessMLDSAIdentity(SignProcessID: Integer; Const CertificateDER, PrivateKeyDER: AnsiString): Integer;

ActiveX

Function PDFlib::SetSignProcessMLDSAIdentity(SignProcessID As Long, CertificateDER As Variant, PrivateKeyDER As Variant) As Long

DLL

int DLSetSignProcessMLDSAIdentity(int InstanceID, int SignProcessID, const char* CertificateDER, int CertificateLength, const char* PrivateKeyDER, int PrivateKeyLength);

Parameters

SignProcessIDSignature process handle returned by a NewSignProcessFrom* function
CertificateDERDER-encoded X.509 certificate whose subject-public-key algorithm is id-ML-DSA-44, id-ML-DSA-65 or id-ML-DSA-87; the parameter set is selected from the certificate
PrivateKeyDERRaw 32-byte seed, or an unencrypted PKCS #8 v2 value wrapping one; the public key is re-derived from it and compared with the certificate before signing

Return values

1The identity was attached
0The process id is invalid or an input is empty; the key pair fails validation at signing time

See also

SetSignProcessEd25519Identity, SetSignProcessEd448Identity, SetSignProcessDigestAlgorithm