Esempio n. 1
0
 /// <summary>Returns a value that indicates whether the key identifier for this instance matches the specified X.509 certificate.</summary>
 /// <param name="certificate">An <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> that contains the X.509 certificate to compare.</param>
 /// <returns>
 /// <see langword="true" /> if <paramref name="certificate" /> has the same issuer name and issuer serial number as the current instance; otherwise, <see langword="false" />.</returns>
 public bool Matches(X509Certificate2 certificate)
 {
     if (certificate == null)
     {
         return(false);
     }
     return(this.Matches(certificate.Issuer, Asn1IntegerConverter.Asn1IntegerToDecimalString(certificate.GetSerialNumber())));
 }
Esempio n. 2
0
 /// <summary>Initializes a new instance of the <see cref="T:System.IdentityModel.Tokens.X509IssuerSerialKeyIdentifierClause" /> class using the specified X.509 certificate. </summary>
 /// <param name="certificate">An <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> that contains the X.509 certificate.</param>
 /// <exception cref="T:System.ArgumentNullException">
 /// <paramref name="certificate" /> is <see langword="null" />.</exception>
 public X509IssuerSerialKeyIdentifierClause(X509Certificate2 certificate)
     : base((string)null)
 {
     if (certificate == null)
     {
         throw new ArgumentNullException(nameof(certificate));
     }
     this.issuerName         = certificate.Issuer;
     this.issuerSerialNumber = Asn1IntegerConverter.Asn1IntegerToDecimalString(certificate.GetSerialNumber());
 }