Class CertificateExtensions
Extensions for X509Certificate2
.
Inheritance
System.Object
CertificateExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ComponentSpace.Saml2.Utility
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class CertificateExtensions
Methods
GetPrivateAsymmetricAlgorithm(X509Certificate2)
Gets the private asymmetric key. This can either be an RSA
or ECDsa
.
Declaration
public static AsymmetricAlgorithm GetPrivateAsymmetricAlgorithm(this X509Certificate2 x509Certificate)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | x509Certificate | The X.509 certificate. |
Returns
Type | Description |
---|---|
System.Security.Cryptography.AsymmetricAlgorithm | The private asymmetric key or |
Exceptions
Type | Condition |
---|---|
SamlCertificateException | Thrown when there's no private asymmetric key. |
GetPublicAsymmetricAlgorithm(X509Certificate2)
Gets the public asymmetric key. This can either be an RSA
or ECDsa
.
Declaration
public static AsymmetricAlgorithm GetPublicAsymmetricAlgorithm(this X509Certificate2 x509Certificate)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | x509Certificate | The X.509 certificate. |
Returns
Type | Description |
---|---|
System.Security.Cryptography.AsymmetricAlgorithm | The public asymmetric key. |
Exceptions
Type | Condition |
---|---|
SamlCertificateException | Thrown when there's no public asymmetric key. |