RSACertificateExtensions::GetRSAPrivateKey Method (X509Certificate2^)

 

Gets the RSA private key from the X509Certificate2.

Namespace:   System.Security.Cryptography.X509Certificates
Assembly:  System.Core (in System.Core.dll)

public:
[ExtensionAttribute]
static RSA^ GetRSAPrivateKey(
	X509Certificate2^ certificate
)

Parameters

certificate
Type: System.Security.Cryptography.X509Certificates::X509Certificate2^

The certificate.

Return Value

Type: System.Security.Cryptography::RSA^

The private key, or null if the certificate does not have an RSA private key.

Exception Condition
ArgumentNullException

certificate is null.

.NET Framework
Available since 4.6
Return to top
Show: