C# Class Thinktecture.IdentityModel.Utility.X509Certificates

Helper class to retrieve certificates from configuration
Show file Open project: IdentityModel/Thinktecture.IdentityModel.v1

Public Methods

Method Description
DownloadSslCertificate ( string machineName, int port ) : X509Certificate2

Downloads the SSL certificate from an SSL site.

GetCertificate ( string name ) : X509Certificate2

Retrieves a named certificate.

GetCertificate ( string name, string password ) : X509Certificate2

Retrieves a named certificate.

GetCertificateFromStore ( StoreLocation location, StoreName name, X509FindType findType, object value ) : X509Certificate2

Retrieves a certificate from the certificate store.

GetCertificateFromStore ( string subjectDistinguishedName ) : X509Certificate2

Retrieves a certificate from the current user / personal certificate store.

GetCertificateFromStore ( string subjectDistinguishedName, StoreLocation location ) : X509Certificate2

Retrieves a certificate from the specified personal certificate store.

Private Methods

Method Description
GetReference ( string name ) : CertificateReferenceElement

Retrieves a named certificate reference.

Method Details

DownloadSslCertificate() public static method

Downloads the SSL certificate from an SSL site.
public static DownloadSslCertificate ( string machineName, int port ) : X509Certificate2
machineName string Name of the machine.
port int The port.
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificate() public static method

Retrieves a named certificate.
public static GetCertificate ( string name ) : X509Certificate2
name string The name.
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificate() public static method

Retrieves a named certificate.
public static GetCertificate ( string name, string password ) : X509Certificate2
name string The name.
password string The password.
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromStore() public static method

Retrieves a certificate from the certificate store.
public static GetCertificateFromStore ( StoreLocation location, StoreName name, X509FindType findType, object value ) : X509Certificate2
location StoreLocation The location.
name StoreName The name.
findType X509FindType Type of the find.
value object The value.
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromStore() public static method

Retrieves a certificate from the current user / personal certificate store.
public static GetCertificateFromStore ( string subjectDistinguishedName ) : X509Certificate2
subjectDistinguishedName string The subject distinguished name of the certificate.
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromStore() public static method

Retrieves a certificate from the specified personal certificate store.
public static GetCertificateFromStore ( string subjectDistinguishedName, StoreLocation location ) : X509Certificate2
subjectDistinguishedName string The subject distinguished name of the certificate.
location StoreLocation The store location.
return System.Security.Cryptography.X509Certificates.X509Certificate2