ECDiffieHellmanOpenSsl.DeriveKeyFromHash 方法

定义

使用指定的哈希算法对可选的添加数据或追加数据执行密钥派生。

public:
 override cli::array <System::Byte> ^ DeriveKeyFromHash(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ secretPrepend, cli::array <System::Byte> ^ secretAppend);
public override byte[] DeriveKeyFromHash (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] secretPrepend, byte[] secretAppend);
public override byte[] DeriveKeyFromHash (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? secretPrepend, byte[]? secretAppend);
override this.DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] -> byte[]
Public Overrides Function DeriveKeyFromHash (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName, secretPrepend As Byte(), secretAppend As Byte()) As Byte()

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公钥。

hashAlgorithm
HashAlgorithmName

用于派生密钥材料的哈希算法。

secretPrepend
Byte[]

在进行哈希算法之前,要预置到派生密钥前面的值。

secretAppend
Byte[]

在进行哈希算法之前,要追加到派生密钥的值。

返回

Byte[]

按需添加数据或追加数据之后的共享机密的哈希值。

例外

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

- 或 -

hashAlgorithm 参数未指定哈希值。

otherPartyPublicKeynull

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

- 或 -

此实例仅表示一个公钥。

适用于