X509Certificate2Extensions Class

Provides extension methods for X509Certificate2 with PQ support.


Definition

namespace WvdS.System.Security.Cryptography.X509Certificates
 
public static class X509Certificate2Extensions

Methods

Name Description
CopyWithPrivateKey(RSA, CryptoMode?) Copies certificate with RSA private key and optional PQ key
CopyWithPrivateKey(ECDsa, CryptoMode?) Copies certificate with ECDsa private key and optional PQ key
HasPqSignature() Checks if PQ signature extension is present
GetCryptoMode() Determines the crypto mode of the certificate
GetSignatureAlgorithmDescription() Returns readable algorithm description

Remarks

This extension class extends System.Security.Cryptography.X509Certificates.X509Certificate21).


Example

using WvdS.System.Security.Cryptography.X509Certificates;
 
var cert = new X509Certificate2("server.pfx", "password");
 
// Check PQ status
if (cert.HasPqSignature())
{
    Console.WriteLine($"Mode: {cert.GetCryptoMode()}");
    Console.WriteLine($"Algorithm: {cert.GetSignatureAlgorithmDescription()}");
    // Output: "RSA2048 + ML-DSA-65 (Hybrid)"
}

See Also


Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional

Zuletzt geändert: on 2026/01/30 at 12:17 AM