Compartir a través de


ECDsaCertificateExtensions.CopyWithPrivateKey(X509Certificate2, ECDsa) Método

Definición

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

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

Parámetros

certificate
X509Certificate2

Certificado ECDSA.

privateKey
ECDsa

Clave privada de ECDSA.

Devoluciones

Nuevo certificado ECDSA con la propiedad HasPrivateKey establecida en true. El objeto de certificado ECDSA 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