ECDiffieHellman.DeriveKeyFromHmac Metodo

Definizione

Esegue la derivazione della chiave usando un algoritmo HMAC (Hash-based Message Authentication Code) specificato.

Overload

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

Dopo l'implementazione in una classe derivata, esegue la derivazione della chiave usando un algoritmo HMAC (Hash-based Message Authentication Code) specificato con dati facoltativi anteposti o accodati.

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[])

Esegue la derivazione della chiave usando un algoritmo HMAC (Hash-based Message Authentication Code) specificato.

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

Source:
ECDiffieHellman.cs
Source:
ECDiffieHellman.cs
Source:
ECDiffieHellman.cs

Dopo l'implementazione in una classe derivata, esegue la derivazione della chiave usando un algoritmo HMAC (Hash-based Message Authentication Code) specificato con dati facoltativi anteposti o accodati.

public:
 virtual 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 virtual byte[] DeriveKeyFromHmac (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey, byte[]? secretPrepend, byte[]? secretAppend);
public virtual byte[] DeriveKeyFromHmac (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] hmacKey, byte[] secretPrepend, byte[] secretAppend);
abstract member DeriveKeyFromHmac : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] * byte[] -> byte[]
override this.DeriveKeyFromHmac : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] * byte[] -> byte[]
Public Overridable Function DeriveKeyFromHmac (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName, hmacKey As Byte(), secretPrepend As Byte(), secretAppend As Byte()) As Byte()

Parametri

otherPartyPublicKey
ECDiffieHellmanPublicKey

Chiave pubblica dell'altra parte.

hashAlgorithm
HashAlgorithmName

Algoritmo hash da usare per derivare il materiale della chiave.

hmacKey
Byte[]

Chiave del valore HMAC.

secretPrepend
Byte[]

Valore da anteporre al segreto derivato prima dell'hashing.

secretAppend
Byte[]

Valore da aggiungere al segreto derivato prima dell'hashing.

Restituisce

Byte[]

HMAC del segreto condiviso dopo aver anteposto o accodato i dati come richiesto.

Eccezioni

Una classe derivata deve eseguire l'override di questo metodo.

La curva usata da otherPartyPublicKey ha dimensioni diverse rispetto alla curva da questa chiave.

-oppure-

Il parametro hashAlgorithm non specifica un hash.

otherPartyPublicKey è null.

La curva usata da otherPartyPublicKey è diversa dalla curva da questa chiave.

-oppure-

Questa istanza rappresenta solo una chiave pubblica.

Commenti

Questo metodo esegue internamente il contratto di chiave Elliptic Curve Diffie-Hellman per produrre il segreto condiviso (z).

Quando hmacKey è null, il valore restituito da questo metodo è il risultato dell'uso dell'algoritmo HMAC-HASH(z, secretPrepend || z || secretAppend) HMAC specificato, dove || indica la concatenazione. In caso contrario, il valore restituito da questo metodo è il risultato di HMAC-HASH(hmacKey, secretPrepend || z || secretAppend).

Se il valore di secretPrepend o secretAppend è null, vengono considerati come matrici vuote.

Si applica a

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[])

Source:
ECDiffieHellman.cs
Source:
ECDiffieHellman.cs
Source:
ECDiffieHellman.cs

Esegue la derivazione della chiave usando un algoritmo HMAC (Hash-based Message Authentication Code) specificato.

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

Parametri

otherPartyPublicKey
ECDiffieHellmanPublicKey

Chiave pubblica dell'altra parte.

hashAlgorithm
HashAlgorithmName

Algoritmo hash da usare per derivare il materiale della chiave.

hmacKey
Byte[]

Chiave del valore HMAC.

Restituisce

Byte[]

HMAC del segreto condiviso.

Eccezioni

La curva usata da otherPartyPublicKey ha dimensioni diverse rispetto alla curva da questa chiave.

-oppure-

Il parametro hashAlgorithm non specifica un hash.

otherPartyPublicKey è null.

La curva usata da otherPartyPublicKey è diversa dalla curva da questa chiave.

-oppure-

Questa istanza rappresenta solo una chiave pubblica.

Commenti

Questo overload chiama il DeriveKeyFromHmac metodo passando null come valori anteponiti e accodati.

Si applica a