Επεξεργασία

Κοινή χρήση μέσω


SubjectIdentifier.MatchesCertificate(X509Certificate2) Method

Definition

Verifies if the specified certificate's subject identifier matches current subject identifier instance.

public:
 bool MatchesCertificate(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public bool MatchesCertificate (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
member this.MatchesCertificate : System.Security.Cryptography.X509Certificates.X509Certificate2 -> bool
Public Function MatchesCertificate (certificate As X509Certificate2) As Boolean

Parameters

certificate
X509Certificate2

The certificate to match with the current subject identifier instance.

Returns

true if the specified certificate's identifier matches the current subject identifier instance; otherwise, false.

Exceptions

Invalid subject identifier type.

Remarks

If the current subject identifier instance is of type SubjectIdentifierType.IssuerAndSerialNumber, this method compares the current instance's X09 issuer serial number and issuer name with the specified certificate's issuer serial number and issuer name. If the current subject identifier instance is of type SubjectIdentifierType.SubjectKeyIdentifier, this method compares the current instance's subject key identifier with the specified certificate's subject key identifier.

Applies to