Beispiel #1
0
 public static X509Certificate2 GetCertificateByThumbprint(
     StoreName storeName,
     StoreLocation storeLocation,
     string thumbPrint)
 {
     return(CertificateHelper.GetCertificate(storeName, storeLocation, X509FindType.FindByThumbprint, thumbPrint));
 }
Beispiel #2
0
        // The signing certificate, computed based on signing store settings.
        public X509Certificate2 GetSigningCertificate()
        {
            Utility.IfNullThrowNullArgumentException(this.StoreIdentifyingValue, "signingStoreIdentifyingValue");

            X509Certificate2 certificate = CertificateHelper.GetCertificate(
                this.StoreName,
                this.StoreLocation,
                this.StoreFindType,
                this.StoreIdentifyingValue);

            // GetCertificate will throw an exception if no certificate is found.
            // Here, we are sure that the certificate is not null.
            return(certificate);
        }