Class CertificateHelper
Provides helper methods for X.509 certificates.
Inherited Members
Namespace: ComponentSpace.SAML2.Utility
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class CertificateHelper
Methods
GetPrivateKey(X509Certificate2)
Gets the private key from the certificate using the most appropriate method.
Declaration
public static AsymmetricAlgorithm GetPrivateKey(X509Certificate2 x509Certificate)
Parameters
| Type | Name | Description |
|---|---|---|
| X509Certificate2 | x509Certificate | The certificate. |
Returns
| Type | Description |
|---|---|
| AsymmetricAlgorithm | The private key. |
Exceptions
| Type | Condition |
|---|---|
| SAMLCertificateException | Thrown when there's no private asymmetric key. |
GetPublicKey(X509Certificate2)
Gets the public key from the certificate using the most appropriate method.
Declaration
public static AsymmetricAlgorithm GetPublicKey(X509Certificate2 x509Certificate)
Parameters
| Type | Name | Description |
|---|---|---|
| X509Certificate2 | x509Certificate | The certificate. |
Returns
| Type | Description |
|---|---|
| AsymmetricAlgorithm | The public key. |
Exceptions
| Type | Condition |
|---|---|
| SAMLCertificateException | Thrown when there's no public asymmetric key. |