GenerateKeyPair Method
GenerateKeyPair(ECCurve)
Generates a elliptic curve public/private keypair that can be used for ECDH operations.
C#
ECParameters GenerateKeyPair(ECCurve curve)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.ECCurve | curve | The elliptic curve that the keypair should be generated on. |
Returns
System.Security.Cryptography.ECParameters
An ECParameters
structure representing the Curve
, the public point Q
, and the private key D
.
Remarks
As of SDK 1.5.0, only the named curves `ECCurve.NamedCurves.nistP256`, `ECCurve.NamedCurves.nistP384`, and `ECCurve.NamedCurves.nistP521` are required to be supported.
Callers of this function should take care when handling this structure. Since it will contain the private key value in `D`, it is recommended that `CryptographicOperations.ZeroMemory` be called as soon as the key is no longer needed.