ECDiffieHellman.DeriveKeyFromHash Método

Definición

Realiza la derivación de claves mediante un algoritmo hash especificado.

Sobrecargas

Nombre Description
DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

Realiza la derivación de claves mediante un algoritmo hash especificado.

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[])

Cuando se implementa en una clase derivada, realiza la derivación de claves mediante un algoritmo hash especificado con datos antepuestos o anexados opcionales.

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

Realiza la derivación de claves mediante un algoritmo hash especificado.

public:
 cli::array <System::Byte> ^ DeriveKeyFromHash(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Function DeriveKeyFromHash (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName) As Byte()

Parámetros

otherPartyPublicKey
ECDiffieHellmanPublicKey

La clave pública de la otra parte.

hashAlgorithm
HashAlgorithmName

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

Devoluciones

Byte[]

Hash del secreto compartido.

Excepciones

La curva usada por otherPartyPublicKey tiene un tamaño diferente al de la curva de esta clave.

O bien

El hashAlgorithm parámetro no especifica un hash.

otherPartyPublicKey es null.

La curva utilizada por otherPartyPublicKey es diferente de la curva de esta clave.

O bien

Esta instancia representa solo una clave pública.

Comentarios

Esta sobrecarga llama al DeriveKeyFromHash método que pasa null como anteponer y anexar valores.

Se aplica a

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[])

Cuando se implementa en una clase derivada, realiza la derivación de claves mediante un algoritmo hash especificado con datos antepuestos o anexados opcionales.

public:
 virtual cli::array <System::Byte> ^ DeriveKeyFromHash(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ secretPrepend, cli::array <System::Byte> ^ secretAppend);
public virtual byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] secretPrepend, byte[] secretAppend);
abstract member DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] -> byte[]
override this.DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] -> byte[]
Public Overridable Function DeriveKeyFromHash (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName, secretPrepend As Byte(), secretAppend As Byte()) As Byte()

Parámetros

otherPartyPublicKey
ECDiffieHellmanPublicKey

La clave pública de la otra parte.

hashAlgorithm
HashAlgorithmName

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

secretPrepend
Byte[]

Valor que se va a anteponer al secreto derivado antes del hash.

secretAppend
Byte[]

Valor que se va a anexar al secreto derivado antes del hash.

Devoluciones

Byte[]

Hash del secreto compartido después de tener datos pendientes o anexados según se solicite.

Excepciones

Una clase derivada debe invalidar este método.

La curva usada por otherPartyPublicKey tiene un tamaño diferente al de la curva de esta clave.

O bien

El hashAlgorithm parámetro no especifica un hash.

otherPartyPublicKey es null.

La curva utilizada por otherPartyPublicKey es diferente de la curva de esta clave.

O bien

Esta instancia representa solo una clave pública.

Comentarios

Este método realiza internamente la curva elíptica Diffie-Hellman acuerdo de clave para generar el secreto compartido (z). El valor devuelto de este método es el resultado del HASH(secretPrepend || z || secretAppend) uso del algoritmo hash especificado, donde || significa la concatenación.

Si el valor de secretPrepend o secretAppend es null, se tratan como matrices vacías.

Se aplica a