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