संपादित करें

इसके माध्यम से साझा किया गया


ECDiffieHellmanCng.DeriveKeyFromHmac Method

Definition

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

Byte[]

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