ECDiffieHellmanCng.DeriveKeyMaterial 方法

定义

派生由双方之间的机密协议生成的密钥材料。

重载

名称 说明
DeriveKeyMaterial(CngKey)

根据包含第二方公钥的对象,派生两方 CngKey 之间的机密协议生成的密钥材料。

DeriveKeyMaterial(ECDiffieHellmanPublicKey)

根据包含第二方公钥的对象,派生两方 ECDiffieHellmanPublicKey 之间的机密协议生成的密钥材料。

注解

椭圆曲线 Diffie-Hellman(ECDH)算法接受私钥和对方公钥作为输入,并将机密协议生成为输出。 然后,密钥派生函数 (KDF) 采用机密协议,并生成密钥材料作为输出。

DeriveKeyMaterial(CngKey)

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

根据包含第二方公钥的对象,派生两方 CngKey 之间的机密协议生成的密钥材料。

public:
 cli::array <System::Byte> ^ DeriveKeyMaterial(System::Security::Cryptography::CngKey ^ otherPartyPublicKey);
public byte[] DeriveKeyMaterial(System.Security.Cryptography.CngKey otherPartyPublicKey);
[System.Security.SecurityCritical]
public byte[] DeriveKeyMaterial(System.Security.Cryptography.CngKey otherPartyPublicKey);
override this.DeriveKeyMaterial : System.Security.Cryptography.CngKey -> byte[]
[<System.Security.SecurityCritical>]
override this.DeriveKeyMaterial : System.Security.Cryptography.CngKey -> byte[]
Public Function DeriveKeyMaterial (otherPartyPublicKey As CngKey) As Byte()

参数

otherPartyPublicKey
CngKey

一个对象,该对象包含来自密钥交换中对方的椭圆曲线 Diffie-Hellman(ECDH)密钥的公共部分。

返回

Byte[]

包含键材料的字节数组。 此信息是从当前对象的私钥和指定的公钥计算的机密协议生成的。

属性

例外

otherPartyPublicKeynull

otherPartyPublicKey 无效。 其 AlgorithmGroup 属性未指定 ECDiffieHellman ,或者其键大小与此实例的键大小不匹配。

此对象的 KeyDerivationFunction 属性指定 Tls 键派生函数,但 Label 要么指定或 Seed 指定 null

所有其他错误。

适用于

DeriveKeyMaterial(ECDiffieHellmanPublicKey)

根据包含第二方公钥的对象,派生两方 ECDiffieHellmanPublicKey 之间的机密协议生成的密钥材料。

public:
 override cli::array <System::Byte> ^ DeriveKeyMaterial(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey);
public override byte[] DeriveKeyMaterial(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);
override this.DeriveKeyMaterial : System.Security.Cryptography.ECDiffieHellmanPublicKey -> byte[]
Public Overrides Function DeriveKeyMaterial (otherPartyPublicKey As ECDiffieHellmanPublicKey) As Byte()

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

密钥交换中对方的公钥。

返回

Byte[]

包含键材料的字节数组。 此信息是从当前对象的私钥和指定的公钥计算的机密协议生成的。

例外

otherPartyPublicKeynull

otherPartyPublicKey 不是 ECDiffieHellmanCngPublicKey 键。

适用于