ECDiffieHellman.Create 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立一個新的橢圓曲線 Diffie-Hellman(ECDH)演算法實作實例。
多載
| 名稱 | Description |
|---|---|
| Create() |
建立橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例。 |
| Create(ECCurve) |
建立橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例,並於指定曲線上產生新的公私鑰對。 |
| Create(ECParameters) |
建立一個基於指定 ECParameters 物件所描述金鑰的橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例。 |
| Create(String) |
已淘汰.
建立指定橢圓曲線 Diffie-Hellman(ECDH)演算法實作的新實例。 |
Create()
建立橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例。
public:
static System::Security::Cryptography::ECDiffieHellman ^ Create();
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.ECDiffieHellman Create();
public static System.Security.Cryptography.ECDiffieHellman Create();
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member Create : unit -> System.Security.Cryptography.ECDiffieHellman
static member Create : unit -> System.Security.Cryptography.ECDiffieHellman
Public Shared Function Create () As ECDiffieHellman
傳回
這是這個類別預設實作的新實例。
- 屬性
適用於
Create(ECCurve)
建立橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例,並於指定曲線上產生新的公私鑰對。
public:
static System::Security::Cryptography::ECDiffieHellman ^ Create(System::Security::Cryptography::ECCurve curve);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECCurve curve);
public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECCurve curve);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member Create : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDiffieHellman
static member Create : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDiffieHellman
Public Shared Function Create (curve As ECCurve) As ECDiffieHellman
參數
- curve
- ECCurve
用來產生新的公私鑰對的曲線。
傳回
橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例。
- 屬性
例外狀況
curve 不驗證。
備註
曲線必須驗證(也就是說,當它傳給 ECCurve.Validate 方法時必須回傳為真)。
特徵二曲線在 Windows 上不被支援。
另請參閱
適用於
Create(ECParameters)
建立一個基於指定 ECParameters 物件所描述金鑰的橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例。
public:
static System::Security::Cryptography::ECDiffieHellman ^ Create(System::Security::Cryptography::ECParameters parameters);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECParameters parameters);
public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECParameters parameters);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member Create : System.Security.Cryptography.ECParameters -> System.Security.Cryptography.ECDiffieHellman
static member Create : System.Security.Cryptography.ECParameters -> System.Security.Cryptography.ECDiffieHellman
Public Shared Function Create (parameters As ECParameters) As ECDiffieHellman
參數
- parameters
- ECParameters
橢圓曲線密碼學(ECC)演算法的參數。
傳回
橢圓曲線 Diffie-Hellman(ECDH)演算法預設實作的新實例。
- 屬性
例外狀況
parameters 不驗證。
備註
parameters 必須驗證(即必須回傳 true),當傳遞給 ECParameters.Validate 方法時。 不支援隱式曲線的參數。
特徵二曲線在 Windows 上不被支援。
另請參閱
適用於
Create(String)
警告
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
建立指定橢圓曲線 Diffie-Hellman(ECDH)演算法實作的新實例。
public:
static System::Security::Cryptography::ECDiffieHellman ^ Create(System::String ^ algorithm);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
[System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.ECDiffieHellman? Create(string algorithm);
public static System.Security.Cryptography.ECDiffieHellman? Create(string algorithm);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
public static System.Security.Cryptography.ECDiffieHellman? Create(string algorithm);
public static System.Security.Cryptography.ECDiffieHellman Create(string algorithm);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]
[<System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Create : string -> System.Security.Cryptography.ECDiffieHellman
static member Create : string -> System.Security.Cryptography.ECDiffieHellman
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]
static member Create : string -> System.Security.Cryptography.ECDiffieHellman
Public Shared Function Create (algorithm As String) As ECDiffieHellman
參數
- algorithm
- String
ECDH 演算法的一種實作名稱。
傳回
這是該類別指定實作的新實例。 若指定的演算法名稱未對應到 ECDH 實作,此方法會回傳 null。
- 屬性
例外狀況
參數 algorithm 為 null。
備註
如果你自己開發物件實作 ECDiffieHellman ,可以用 Create(String) 方法超載來建立 algorithm 自訂字串來指定你的實作。
該 algorithm 參數指定 ECDH 演算法實作的名稱。 以下字串皆指同一實作,這是目前 .NET 框架中唯一支援的實作:
「ECDH」
「ECDiffieHellman」
「ECDiffieHellmanCng」
「系統.安全.密碼學.ECDiffieHellmanCng」
你也可以提供參數的自訂 ECDH 實作 algorithm 名稱。 如果你這麼做, CryptoConfig 物件會用它來判斷是否能建立 ECDH 物件。