Interface ICertificateLoader
The certificate loader loads X.509 certificates.
Namespace: ComponentSpace.SAML2.Certificates
Assembly: ComponentSpace.Saml2.dll
Syntax
public interface ICertificateLoader
Properties
KeyStorageFlags
Gets or sets the key storage flags to use when loading X.509 certificates.
Declaration
X509KeyStorageFlags KeyStorageFlags { get; set; }
Property Value
Type | Description |
---|---|
X509KeyStorageFlags | The key storage flags to use when loading X.509 certificates. |
Methods
LoadCertificateFromFile(string, string)
Loads an X.509 certificate from the file system.
Declaration
X509Certificate2 LoadCertificateFromFile(string certificateFile, string certificatePassword)
Parameters
Type | Name | Description |
---|---|---|
string | certificateFile | The certificate file name. |
string | certificatePassword | The certificate file password or |
Returns
Type | Description |
---|---|
X509Certificate2 | The X.509 certificate. |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the X.509 certificates cannot be loaded. |
LoadCertificateFromKey(string)
Loads an X.509 certificate from elsewhere in the configuration.
This may be used to retrieve certificates stored in an Azure key vault.
Declaration
X509Certificate2 LoadCertificateFromKey(string certificateKey)
Parameters
Type | Name | Description |
---|---|---|
string | certificateKey | The configuration key. |
Returns
Type | Description |
---|---|
X509Certificate2 | The X.509 certificate. |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the X.509 certificates cannot be loaded. |
LoadCertificateFromStore(StoreLocation, string, X509FindType, object)
Loads an X.509 certificate from the Windows Certificate Store.
Declaration
X509Certificate2 LoadCertificateFromStore(StoreLocation storeLocation, string storeName, X509FindType findType, object findValue)
Parameters
Type | Name | Description |
---|---|---|
StoreLocation | storeLocation | The store location. |
string | storeName | The store name. |
X509FindType | findType | The find type for searching the certificate store. |
object | findValue | The find value for searching the certificate store. |
Returns
Type | Description |
---|---|
X509Certificate2 | The X.509 certificate. |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the X.509 certificates cannot be loaded. |
LoadCertificateFromString(string, string)
Loads an X.509 certificate from a base-64 encoded string.
Declaration
X509Certificate2 LoadCertificateFromString(string certificateString, string certificatePassword)
Parameters
Type | Name | Description |
---|---|---|
string | certificateString | The certificate base-64 encoded string. |
string | certificatePassword | The certificate file password or |
Returns
Type | Description |
---|---|
X509Certificate2 | The X.509 certificate. |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the X.509 certificates cannot be loaded. |