Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Security.​Cryptography.​X509Certificates.​RSACertificateExtensions
Assembly: System.Security.Cryptography
Inheritance: object → RSACertificateExtensions
Provides extension methods for retrieving <see cref="T:System.Security.Cryptography.RSA" /> implementations for the public and private keys of an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> .
Methods
public static
X509Certificate2
CopyWithPrivateKey​(X509Certificate2 certificate,
RSA privateKey)
Combines a private key with the public key of an <see cref="T:System.Security.Cryptography.RSA" /> certificate to generate a new RSA certificate.
Returns A new RSA certificate with the <see cref="P:System.Security.Cryptography.X509Certificates.X509Certificate2.HasPrivateKey" /> property set to <see langword="true" /> . The input RSA certificate object isn't modified.
certificate
The RSA certificate.
privateKey
The private RSA key.
public static
RSA
GetRSAPrivateKey​(X509Certificate2 certificate)
Gets the <see cref="T:System.Security.Cryptography.RSA" /> private key from the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> .
Returns The private key, or <see langword="null" /> if the certificate does not have an RSA private key.
certificate
The certificate.
public static
RSA
GetRSAPublicKey​(X509Certificate2 certificate)
Gets the <see cref="T:System.Security.Cryptography.RSA" /> public key from the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> .
Returns The public key, or <see langword="null" /> if the certificate does not have an RSA public key.
certificate
The certificate.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object