Edit

Share via


ECDsaCng Constructors

Definition

Initializes a new instance of the ECDsaCng class.

Overloads

ECDsaCng()

Initializes a new instance of the ECDsaCng class with a random key pair.

ECDsaCng(Int32)

Initializes a new instance of the ECDsaCng class with a specified target key size.

ECDsaCng(CngKey)

Initializes a new instance of the ECDsaCng class by using the specified CngKey object.

ECDsaCng(ECCurve)

Initializes a new instance of the ECDsaCng class whose public/private key pair is generated over the specified curve.

ECDsaCng()

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Initializes a new instance of the ECDsaCng class with a random key pair.

public:
 ECDsaCng();
public ECDsaCng ();
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public ECDsaCng ();
Public Sub New ()
Attributes

Exceptions

Cryptography Next Generation (CNG) classes are not supported on this system.

Remarks

This constructor does not generate a new public/private keypair immediately. This constructor sets the KeySize property to 521 and when a key is needed the saved size is used to identify the target curve. If a key is loaded via the ImportParameters method, or other key import method, the key size from this constructor has no meaning.

See also

Applies to

ECDsaCng(Int32)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Initializes a new instance of the ECDsaCng class with a specified target key size.

public:
 ECDsaCng(int keySize);
public ECDsaCng (int keySize);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public ECDsaCng (int keySize);
[System.Security.SecurityCritical]
public ECDsaCng (int keySize);
new System.Security.Cryptography.ECDsaCng : int -> System.Security.Cryptography.ECDsaCng
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.ECDsaCng : int -> System.Security.Cryptography.ECDsaCng
[<System.Security.SecurityCritical>]
new System.Security.Cryptography.ECDsaCng : int -> System.Security.Cryptography.ECDsaCng
Public Sub New (keySize As Integer)

Parameters

keySize
Int32

The size of the key. Valid key sizes are 256, 384, and 521 bits.

Attributes

Exceptions

Cryptography Next Generation (CNG) classes are not supported on this system.

keySize specifies an invalid length.

Remarks

This constructor does not generate a new public/private keypair immediately. This constructor sets the KeySize property to the provided value and when a key is needed the saved size is used to identify the target curve. If a key is loaded via the ImportParameters method, or other key import method, the key size from this constructor has no meaning.

See also

Applies to

ECDsaCng(CngKey)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Initializes a new instance of the ECDsaCng class by using the specified CngKey object.

public:
 ECDsaCng(System::Security::Cryptography::CngKey ^ key);
public ECDsaCng (System.Security.Cryptography.CngKey key);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public ECDsaCng (System.Security.Cryptography.CngKey key);
[System.Security.SecurityCritical]
public ECDsaCng (System.Security.Cryptography.CngKey key);
new System.Security.Cryptography.ECDsaCng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.ECDsaCng
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.ECDsaCng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.ECDsaCng
[<System.Security.SecurityCritical>]
new System.Security.Cryptography.ECDsaCng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.ECDsaCng
Public Sub New (key As CngKey)

Parameters

key
CngKey

The key that will be used as input to the cryptographic operations performed by the current object.

Attributes

Exceptions

key does not specify an Elliptic Curve Digital Signature Algorithm (ECDSA) group.

key is null.

Cryptography Next Generation (CNG) classes are not supported on this system.

Applies to

ECDsaCng(ECCurve)

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Initializes a new instance of the ECDsaCng class whose public/private key pair is generated over the specified curve.

public:
 ECDsaCng(System::Security::Cryptography::ECCurve curve);
public ECDsaCng (System.Security.Cryptography.ECCurve curve);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public ECDsaCng (System.Security.Cryptography.ECCurve curve);
new System.Security.Cryptography.ECDsaCng : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDsaCng
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
new System.Security.Cryptography.ECDsaCng : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDsaCng
Public Sub New (curve As ECCurve)

Parameters

curve
ECCurve

The curve used to generate the public/private key pair.

Attributes

Exceptions

curve does not validate.

curve is null.

if curve does not contain an Oid with a FriendlyName.

Remarks

curve must validate (that is, it must return true) when passed to the ECCurve.Validate method and must be either a named or explicit prime.

Applies to