ECDiffieHellmanOpenSsl.DeriveKeyFromHmac Método

Definición

Realiza la derivación de claves mediante un algoritmo HMAC (código de autentificación de mensajes en clave-hash) con datos antepuestos o anexados opcionales.

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

Clave pública de la otra parte.

hashAlgorithm
HashAlgorithmName

Algoritmo hash que se va a usar para derivar el material de clave.

hmacKey
Byte[]

Clave para HMAC.

secretPrepend
Byte[]

Valor para anteponer al secreto derivado antes de la operación hash.

secretAppend
Byte[]

Valor para anexar al secreto derivado antes de la operación hash.

Devoluciones

Byte[]

El HMAC del secreto compartido después de anteponer o anexar datos según se solicite.

Excepciones

La curva que usa otherPartyPublicKey tiene un tamaño diferente que la curva de esta clave.

o bien

El parámetro hashAlgorithm no especifica ningún valor hash.

otherPartyPublicKey es null.

La curva que usa otherPartyPublicKey es diferente de la curva de esta clave.

o bien

Esta instancia representa solo una clave pública.

Se aplica a