RSACertificateExtensions.CopyWithPrivateKey(X509Certificate2, RSA) Metoda

Definicja

Łączy klucz prywatny z kluczem publicznym certyfikatu w celu wygenerowania nowego certyfikatu RSA RSA.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Security::Cryptography::X509Certificates::X509Certificate2 ^ CopyWithPrivateKey(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::RSA ^ privateKey);
public static System.Security.Cryptography.X509Certificates.X509Certificate2 CopyWithPrivateKey (this System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.RSA privateKey);
static member CopyWithPrivateKey : System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.RSA -> System.Security.Cryptography.X509Certificates.X509Certificate2
<Extension()>
Public Function CopyWithPrivateKey (certificate As X509Certificate2, privateKey As RSA) As X509Certificate2

Parametry

certificate
X509Certificate2

Certyfikat RSA.

privateKey
RSA

Prywatny klucz RSA.

Zwraca

X509Certificate2

Nowy certyfikat RSA z właściwością ustawioną HasPrivateKey na true. Obiekt wejściowego certyfikatu RSA nie jest modyfikowany.

Wyjątki

certificate lub privateKey to null.

Certyfikat ma już skojarzony klucz prywatny.

Certyfikat nie ma klucza publicznego.

-lub-

Określony klucz prywatny nie jest zgodny z kluczem publicznym dla określonego certyfikatu.

Dotyczy