====== X509Certificate2Extensions Class ====== Provides extension methods for ''X509Certificate2'' with PQ support. ---- ===== Definition ===== namespace WvdS.System.Security.Cryptography.X509Certificates public static class X509Certificate2Extensions ---- ===== Methods ===== ^ Name ^ Description ^ | [[.:x509certificate2extensions-copywithprivatekey|CopyWithPrivateKey(RSA, CryptoMode?)]] | Copies certificate with RSA private key and optional PQ key | | [[.:x509certificate2extensions-copywithprivatekey-ecdsa|CopyWithPrivateKey(ECDsa, CryptoMode?)]] | Copies certificate with ECDsa private key and optional PQ key | | [[.:x509certificate2extensions-haspqsignature|HasPqSignature()]] | Checks if PQ signature extension is present | | [[.:x509certificate2extensions-getcryptomode|GetCryptoMode()]] | Determines the crypto mode of the certificate | | [[.:x509certificate2extensions-getsignaturealgorithmdescription|GetSignatureAlgorithmDescription()]] | Returns readable algorithm description | ---- ===== Remarks ===== This extension class extends ''System.Security.Cryptography.X509Certificates.X509Certificate2''((Microsoft Docs: https://learn.microsoft.com/dotnet/api/system.security.cryptography.x509certificates.x509certificate2)). ---- ===== 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 ===== * [[.:start|X509Certificates Namespace]] * [[.:certificaterequestextensions|CertificateRequestExtensions]] * [[.:x509chainextensions|X509ChainExtensions]] {{tag>class extension static}} ---- //Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional//