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);

适用于