ECDsaCertificateExtensions.CopyWithPrivateKey(X509Certificate2, ECDsa) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将私钥与 ECDsa 证书的公钥合并,以生成新的 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
参数
- certificate
- X509Certificate2
ECDSA 证书。
- privateKey
- ECDsa
私有 ECDSA 密钥。
返回
新 ECDSA 证书,其 HasPrivateKey 属性设置为 true
。 未修改输入 ECDSA 证书对象。
例外
certificate
或 privateKey
为 null
。
该证书已有关联的私钥。