ECDiffieHellmanCng.DeriveKeyFromHmac 方法

定义

使用具有可选追加或追加数据的指定 HMAC(基于哈希的消息身份验证代码)算法执行密钥派生。

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

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公钥。

hashAlgorithm
HashAlgorithmName

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

hmacKey
Byte[]

HMAC 的密钥。

secretPrepend
Byte[]

要在哈希之前追加到派生机密的值。

secretAppend
Byte[]

要在哈希之前追加到派生机密的值。

返回

Byte[]

在请求追加或追加数据后共享机密的 HMAC。

例外

使用的 otherPartyPublicKey 曲线的大小与此键中的曲线不同。

-或-

hashAlgorithm 参数未指定哈希。

otherPartyPublicKeynull

使用的 otherPartyPublicKey 曲线不同于此键的曲线。

-或-

此实例仅表示公钥。

适用于