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 金鑰。
傳回
HasPrivateKey 屬性設為 true
的新 ECDSA 憑證。 輸入 ECDSA 憑證物件未修改。
例外狀況
certificate
或 privateKey
為 null
。
憑證已有相關的私密金鑰。