Comparteix a través de


DSACertificateExtensions.CopyWithPrivateKey(X509Certificate2, DSA) Método

Definición

Combina una clave privada con la clave pública de un certificado DSA para generar un nuevo certificado DSA.

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

Parámetros

certificate
X509Certificate2

Certificado DSA.

privateKey
DSA

Clave privada de DSA.

Devoluciones

Nuevo certificado DSA con la propiedad HasPrivateKey establecida en true. El objeto de certificado DSA de entrada no se modifica.

Excepciones

certificate o privateKey es null.

El certificado ya tiene asociada una clave privada.

El certificado no tiene ninguna clave pública.

O bien

La clave privada especificada no coincide con la clave pública del certificado especificado.

Se aplica a