ECDiffieHellmanCng.DeriveKeyFromHmac Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Performs key derivation using a specified HMAC (Hash-based Message Authentication Code) algorithm with optional prepended or appended data.
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()
Parameters
- otherPartyPublicKey
- ECDiffieHellmanPublicKey
The other party's public key.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm to use to derive the key material.
- hmacKey
- Byte[]
The key for the HMAC.
- secretPrepend
- Byte[]
A value to prepend to the derived secret before hashing.
- secretAppend
- Byte[]
A value to append to the derived secret before hashing.
Returns
The HMAC of the shared secret after prepending or appending data as requested.
Exceptions
The curve used by otherPartyPublicKey
has a different size than the curve from this key.
-or-
The hashAlgorithm
parameter does not specify a hash.
otherPartyPublicKey
is null
.
The curve used by otherPartyPublicKey
is different than the curve from this key.
-or-
This instance represents only a public key.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈