ECDiffieHellman.DeriveKeyTls(ECDiffieHellmanPublicKey, Byte[], Byte[]) 方法

定义

在派生类中实现时,使用 TLS(传输层安全性)1.1 PRF(伪随机函数)执行密钥派生。

public:
 virtual cli::array <System::Byte> ^ DeriveKeyTls(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, cli::array <System::Byte> ^ prfLabel, cli::array <System::Byte> ^ prfSeed);
public virtual byte[] DeriveKeyTls (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed);
abstract member DeriveKeyTls : System.Security.Cryptography.ECDiffieHellmanPublicKey * byte[] * byte[] -> byte[]
override this.DeriveKeyTls : System.Security.Cryptography.ECDiffieHellmanPublicKey * byte[] * byte[] -> byte[]
Public Overridable Function DeriveKeyTls (otherPartyPublicKey As ECDiffieHellmanPublicKey, prfLabel As Byte(), prfSeed As Byte()) As Byte()

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公钥。

prfLabel
Byte[]

ASCII 编码的 PRF 标签。

prfSeed
Byte[]

64 字节的 PRF 种子。

返回

Byte[]

使用共享机密作为密钥的 TLS 1.1 PRF 中的前 48 个字节。

例外

派生方法必须重写此方法。

otherPartyPublicKey 使用的曲线的大小与此密钥使用的曲线不同。

otherPartyPublicKeyprfLabelprfSeednull

prfSeed 的长度并不正好是 64 字节。

  • 或 -

otherPartyPublicKey使用的曲线与此密钥使用的曲线不同。

  • 或 -

此实例仅表示一个公钥。

注解

此方法在内部执行椭圆曲线Diffie-Hellman密钥协议,以生成共享机密 (z) 。

此方法的返回值是 TLS 1.1 PRF (伪随机函数) PRF(z, prfLabel, prfSeed)的 48 字节输出。

有关详细信息,请参阅 IETF RFC 4346,第 5 节

适用于