Udostępnij za pośrednictwem


ECDiffieHellmanCng.DeriveKeyFromHmac Metoda

Definicja

Wykonuje wyprowadzanie klucza przy użyciu określonego algorytmu HMAC (opartego na skrótach kodu uwierzytelniania komunikatów) z opcjonalnymi danymi wstępnie dodanymi lub dołączonymi.

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

Parametry

otherPartyPublicKey
ECDiffieHellmanPublicKey

Klucz publiczny innej strony.

hashAlgorithm
HashAlgorithmName

Algorytm skrótu używany do uzyskiwania kluczowego materiału.

hmacKey
Byte[]

Klucz dla HMAC.

secretPrepend
Byte[]

Wartość, która zostanie wstępnie utworzona do pochodnego wpisu tajnego przed utworzeniem skrótu.

secretAppend
Byte[]

Wartość, która ma zostać dołączona do pochodnego wpisu tajnego przed utworzeniem skrótu.

Zwraca

Byte[]

Klucz HMAC udostępnionego wpisu tajnego po wstępnego dołączania lub dołączania danych zgodnie z żądaniem.

Wyjątki

Krzywa używana przez element otherPartyPublicKey ma inny rozmiar niż krzywa z tego klucza.

-lub-

Parametr hashAlgorithm nie określa skrótu.

otherPartyPublicKey to null.

Krzywa używana przez otherPartyPublicKey element różni się od krzywej z tego klucza.

-lub-

To wystąpienie reprezentuje tylko klucz publiczny.

Dotyczy