Skip to content

[API Proposal]: Support for ITU-T X.509 Alternative Signature #122659

@dorssel

Description

@dorssel

Background and motivation

ITU-T Recommendation X.509 (10/2019) Section 9.8 specifies an additional signature to be embedded in the certificate to transition to PQ. It is different from composite signatures (draft-ietf-lamps-pq-composite-sigs) in that it allows clients that are not yet PQ-aware to understand the certificate as an old (classic RSA/ECC) certificate, while modern clients can use/verify both signatures (much like composite signatures).

The use case is different: composite signatures are better when you want to enforce PQ (more like a "critical" extension), whereas alternative signatures are opt-in ("non-critical" extension).

E.g., Bouncy Castle has support for this. It does not require crypto-library support in the sense that the library should handle the additional certificate extensions. The additional signature can be added by managed code (where the signature itself is created by the crypto-library, of course), and likewise for verification.

API Proposal

namespace System.Security.Cryptography.X509Certificates;

public class X509SignatureGenerator
{
    public static CreateForAlternativeSignature(CompositeMLDsa key);
}

I don't think additional API is required. And this utilizes the existing CompositeMLDsa keys, although it will be used differently: when signing (CertificateRequest.Create, etc.), the signature generator class would be recognized as "For Alternative Signatures", which would use the MLDsa key part for the ITU-T certificate extensions, followed by the outer "classical" signature.

Of course, certificate validation (e.g. X509Chain) should recognize the ITU-T certificate extensions for alternative signatures and validate the signature.

API Usage

CompositeMLDsa compositeKey;
signatureGenerator = X509SignatureGenerator.CreateForAlternativeSignature(compositeKey);
CertificateRequest request;
request.CreateSigningRequest(signatureGenerator);
request.Create(signatureGenerator);

Alternative Designs

Alternatively, the user could generate a normal CompositeMLDsa certificate request (not implemented yet, but already planned) and manually add the id-ce-altSignatureAlgorithm extension (or set a flag), after which the certificate would use the CompositeMLDsa key just as a container for essentially two independent key parts.

Risks

I don't see breaking changes in the existing API, but certificate validation is touched everywhere in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.SecurityuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions