Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.46 KB

System.Security.Cryptography.X509Certificates.md

File metadata and controls

39 lines (32 loc) · 1.46 KB

System.Security.Cryptography.X509Certificates


X509Certificate2Extensions

Provides extension methods for the X509Certificate2 class.

public static class X509Certificate2Extensions

Static Methods

GetNameIdentifier

string GetNameIdentifier(this X509Certificate2 certificate)

Summary: Gets the name identifier of the certificate. This can be the FriendlyName, or a substring of the SubjectName.

Parameters:
     certificate  -  The X509Certificate2 object.

Returns: The FriendlyName of the certificate if not null or empty; otherwise, a substring of the SubjectName starting from "CN=" if it exists, or the full SubjectName if "CN=" is not found.

IsValid

bool IsValid(this X509Certificate2 certificate)

Summary: Checks if the certificate is valid. A certificate is considered valid if it is not archived, the current date is within the certificate's validity period, and it has a non-empty name identifier.

Parameters:
     certificate  -  The X509Certificate2 object.

Returns: True if the certificate is valid; otherwise, false.


Generated by MarkdownCodeDoc version 1.2