Show / Hide Table of Contents

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
System.Security.Cryptography.X509Certificates.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
System.String certificateFile

The certificate file name.

System.String certificatePassword

The certificate file password or null if none.

Returns
Type Description
System.Security.Cryptography.X509Certificates.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
System.String certificateKey

The configuration key.

Returns
Type Description
System.Security.Cryptography.X509Certificates.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
System.Security.Cryptography.X509Certificates.StoreLocation storeLocation

The store location.

System.String storeName

The store name.

System.Security.Cryptography.X509Certificates.X509FindType findType

The find type for searching the certificate store.

System.Object findValue

The find value for searching the certificate store.

Returns
Type Description
System.Security.Cryptography.X509Certificates.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
System.String certificateString

The certificate base-64 encoded string.

System.String certificatePassword

The certificate file password or null if none.

Returns
Type Description
System.Security.Cryptography.X509Certificates.X509Certificate2

The X.509 certificate.

Exceptions
Type Condition
SAMLException

Thrown when the X.509 certificates cannot be loaded.

In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2022. All rights reserved.