ECDiffieHellmanCng 构造函数

定义

初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class.

重载

ECDiffieHellmanCng()

使用随机的密钥对初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class with a random key pair.

ECDiffieHellmanCng(Int32)

使用指定密钥大小,通过随机密钥对来初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class with a random key pair, using the specified key size.

ECDiffieHellmanCng(CngKey)

使用指定的 CngKey 对象初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class by using the specified CngKey object.

ECDiffieHellmanCng(ECCurve)

创建 ECDiffieHellmanCng 类的新实例,其公钥/私钥对通过指定曲线生成。Creates a new instance of the ECDiffieHellmanCng class whose public/private key pair is generated over the specified curve.

ECDiffieHellmanCng()

使用随机的密钥对初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class with a random key pair.

public:
 ECDiffieHellmanCng();
public ECDiffieHellmanCng ();
Public Sub New ()

注解

随机密钥对的默认公钥长度为521位。The random key pair has a default public key length of 521 bits.

ECDiffieHellmanCng(Int32)

使用指定密钥大小,通过随机密钥对来初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class with a random key pair, using the specified key size.

public:
 ECDiffieHellmanCng(int keySize);
[System.Security.SecurityCritical]
public ECDiffieHellmanCng (int keySize);
new System.Security.Cryptography.ECDiffieHellmanCng : int -> System.Security.Cryptography.ECDiffieHellmanCng
Public Sub New (keySize As Integer)

参数

keySize
Int32

密钥大小。The size of the key. 有效密钥大小是 256、384 和 521 位。Valid key sizes are 256, 384, and 521 bits.

属性

异常

keySize 指定了无效的长度。keySize specifies an invalid length.

此系统不支持下一代加密技术 (CNG) 类。Cryptography Next Generation (CNG) classes are not supported on this system.

注解

随机密钥对的公钥长度由keySize参数定义。The random key pair will have the public key length defined by the keySize parameter.

ECDiffieHellmanCng(CngKey)

使用指定的 CngKey 对象初始化 ECDiffieHellmanCng 类的新实例。Initializes a new instance of the ECDiffieHellmanCng class by using the specified CngKey object.

public:
 ECDiffieHellmanCng(System::Security::Cryptography::CngKey ^ key);
[System.Security.SecurityCritical]
public ECDiffieHellmanCng (System.Security.Cryptography.CngKey key);
new System.Security.Cryptography.ECDiffieHellmanCng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.ECDiffieHellmanCng
Public Sub New (key As CngKey)

参数

key
CngKey

一个密钥,它将用作当前对象所执行的加密操作的输入。The key that will be used as input to the cryptographic operations performed by the current object.

属性

异常

keynullkey is null.

key 未指定椭圆曲线 Diffie-Hellman (ECDH) 算法组。key does not specify an Elliptic Curve Diffie-Hellman (ECDH) algorithm group.

此系统不支持下一代加密技术 (CNG) 类。Cryptography Next Generation (CNG) classes are not supported on this system.

ECDiffieHellmanCng(ECCurve)

创建 ECDiffieHellmanCng 类的新实例,其公钥/私钥对通过指定曲线生成。Creates a new instance of the ECDiffieHellmanCng class whose public/private key pair is generated over the specified curve.

public:
 ECDiffieHellmanCng(System::Security::Cryptography::ECCurve curve);
public ECDiffieHellmanCng (System.Security.Cryptography.ECCurve curve);
new System.Security.Cryptography.ECDiffieHellmanCng : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDiffieHellmanCng
Public Sub New (curve As ECCurve)

参数

curve
ECCurve

用于生成公钥/私钥对的曲线。The curve used to generate the public/private key pair.

异常

curve 不进行验证。curve does not validate.

注解

curve``true传递ECCurve.Validate给方法时, 必须验证 (即必须返回), 并且必须是已命名或显式质数。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.

适用于