ECDiffieHellman.DeriveKeyFromHash Metode

Definisi

Melakukan derivasi kunci menggunakan algoritma hash tertentu.

Overload

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

Melakukan derivasi kunci menggunakan algoritma hash tertentu.

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

Saat diimplementasikan dalam kelas turunan, melakukan derivasi kunci menggunakan algoritma hash tertentu dengan data opsional yang telah ditambahkan sebelumnya atau ditambahkan.

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

Sumber:
ECDiffieHellman.cs
Sumber:
ECDiffieHellman.cs
Sumber:
ECDiffieHellman.cs

Melakukan derivasi kunci menggunakan algoritma hash tertentu.

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

Parameter

otherPartyPublicKey
ECDiffieHellmanPublicKey

Kunci umum pihak lain.

hashAlgorithm
HashAlgorithmName

Algoritma hash yang digunakan untuk mendapatkan bahan kunci.

Mengembalikan

Byte[]

Hash rahasia bersama.

Pengecualian

Kurva yang digunakan oleh otherPartyPublicKey memiliki ukuran yang berbeda dari kurva dari kunci ini.

-atau-

Parameter hashAlgorithm tidak menentukan hash.

otherPartyPublicKeyadalah null.

Kurva yang digunakan oleh otherPartyPublicKey berbeda dari kurva dari kunci ini.

-atau-

Instans ini hanya mewakili kunci umum.

Keterangan

Kelebihan beban ini memanggil metode yang DeriveKeyFromHash melewati null sebagai nilai prepend dan append.

Berlaku untuk

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

Sumber:
ECDiffieHellman.cs
Sumber:
ECDiffieHellman.cs
Sumber:
ECDiffieHellman.cs

Saat diimplementasikan dalam kelas turunan, melakukan derivasi kunci menggunakan algoritma hash tertentu dengan data opsional yang telah ditambahkan sebelumnya atau ditambahkan.

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

Parameter

otherPartyPublicKey
ECDiffieHellmanPublicKey

Kunci umum pihak lain.

hashAlgorithm
HashAlgorithmName

Algoritma hash yang digunakan untuk mendapatkan bahan kunci.

secretPrepend
Byte[]

Nilai yang akan ditambahkan ke rahasia turunan sebelum hashing.

secretAppend
Byte[]

Nilai untuk ditambahkan ke rahasia turunan sebelum hashing.

Mengembalikan

Byte[]

Hash rahasia bersama setelah menambahkan atau menambahkan data seperti yang diminta.

Pengecualian

Kelas turunan harus mengambil alih metode ini.

Kurva yang digunakan oleh otherPartyPublicKey memiliki ukuran yang berbeda dari kurva dari kunci ini.

-atau-

Parameter hashAlgorithm tidak menentukan hash.

otherPartyPublicKeyadalah null.

Kurva yang digunakan oleh otherPartyPublicKey berbeda dari kurva dari kunci ini.

-atau-

Instans ini hanya mewakili kunci umum.

Keterangan

Metode ini secara internal melakukan Perjanjian kunci Diffie-Hellman Kurva Elips untuk menghasilkan rahasia bersama (z). Nilai yang dikembalikan dari metode ini adalah hasil dari HASH(secretPrepend || z || secretAppend) penggunaan algoritma hash yang ditentukan, di mana || menandakan perangkaian.

Jika nilai secretPrepend atau secretAppend adalah null, nilai tersebut diperlakukan sebagai array kosong.

Berlaku untuk