ECDiffieHellmanCng.DeriveKeyFromHmac Método

Definição

Executa a derivação de chave usando um algoritmo HMAC (Message Authentication Code baseado em hash) especificado com os dados opcionais acrescentados ou anexados.

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()

Parâmetros

otherPartyPublicKey
ECDiffieHellmanPublicKey

A chave pública do outro participante.

hashAlgorithm
HashAlgorithmName

O algoritmo de hash a ser usado para derivar o material de chave.

hmacKey
Byte[]

A chave para o HMAC.

secretPrepend
Byte[]

Um valor a ser precedido ao segredo derivado antes do hash.

secretAppend
Byte[]

Um valor a ser acrescentado ao segredo derivado antes do hash.

Retornos

Byte[]

O HMAC do segredo compartilhado após a anexação ou o acréscimo de dados, conforme solicitado.

Exceções

A curva usada por otherPartyPublicKey tem um tamanho diferente da curva dessa chave.

- ou -

O parâmetro hashAlgorithm não especifica um hash.

otherPartyPublicKey é null.

A curva usada por otherPartyPublicKey é diferente da curva dessa chave.

- ou -

Essa instância representa apenas uma chave pública.

Aplica-se a