Provides extension methods for X509Certificate2 with PQ support.
namespace WvdS.System.Security.Cryptography.X509Certificates public static class X509Certificate2Extensions
| 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 |
This extension class extends System.Security.Cryptography.X509Certificates.X509Certificate21).
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)" }
Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional