共用方式為


AsymmetricKeyAlgorithmProvider.CreateKeyPairWithCurveName(String) 方法

定義

使用演算法曲線名稱建立公開/私密金鑰組。

public:
 virtual CryptographicKey ^ CreateKeyPairWithCurveName(Platform::String ^ curveName) = CreateKeyPairWithCurveName;
CryptographicKey CreateKeyPairWithCurveName(winrt::hstring const& curveName);
public CryptographicKey CreateKeyPairWithCurveName(string curveName);
function createKeyPairWithCurveName(curveName)
Public Function CreateKeyPairWithCurveName (curveName As String) As CryptographicKey

參數

curveName
String

Platform::String

winrt::hstring

曲線的名稱。

傳回

代表產生的橢圓曲線數位簽章演算法, (ECDSA) 非對稱金鑰組。

範例

下列範例會從 CurveName 建立新的 ECDSA 曲線。

AsymmetricKeyAlgorithmProvider eccAlgorithmProvider =
                AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithmNames.EcdsaSha256);
CryptographicKey keyPair = eccAlgorithmProvider.CreateKeyPairWithCurveName(EccCurveNames.Secp160k1);
AsymmetricKeyAlgorithmProvider^ eccAlgorithmProvider = AsymmetricKeyAlgorithmProvider::OpenAlgorithm(
                                                                               AsymmetricAlgorithmNames::EcdsaSha256);
CryptographicKey^ keyPair = eccAlgorithmProvider->CreateKeyPairWithCurveName(EccCurveNames::Secp160k1);

適用於