ECDiffieHellman.DeriveKeyFromHash 方法

定义

使用哈希函数派生可用作密钥的字节。Derives bytes that can be used as a key using a hash function .

重载

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

若给定了另一方的公钥和哈希算法的名称,使用哈希函数派生可用作密钥的字节。Derives bytes that can be used as a key using a hash function, given another party's public key and hash algorithm's name.

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

在派生类中实现时,使用哈希函数、给定的另一方公钥、哈希算法的名称、预置值和追加值可派生用作密钥的字节。When implemented in a derived class, derives bytes that can be used as a key using a hash function, given another party's public key, hash algorithm's name, a prepend value and an append value.

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

若给定了另一方的公钥和哈希算法的名称,使用哈希函数派生可用作密钥的字节。Derives bytes that can be used as a key using a hash function, given another party's public key and hash algorithm's name.

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

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公钥。The other party's public key.

hashAlgorithm
HashAlgorithmName

用于派生密钥材料的哈希算法。The hash algorithm to use to derive the key material.

返回

Byte[]

来自与另一方的公钥进行密钥交换的密钥材料。The key material from the key exchange with the other party's public key.

异常

otherPartyPublicKey 在与此密钥不同的曲线上。otherPartyPublicKey is over a different curve than this key.

注解

此重载调用作为DeriveKeyFromHash预置值null和追加值传递的方法。This overload calls the DeriveKeyFromHash method passing null as the prepend and append values.

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

在派生类中实现时,使用哈希函数、给定的另一方公钥、哈希算法的名称、预置值和追加值可派生用作密钥的字节。When implemented in a derived class, derives bytes that can be used as a key using a hash function, given another party's public key, hash algorithm's name, a prepend value and an append value.

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

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公钥。The other party's public key.

hashAlgorithm
HashAlgorithmName

用于派生密钥材料的哈希算法。The hash algorithm to use to derive the key material.

secretPrepend
Byte[]

在进行哈希算法之前,要预置到派生密钥前面的值。A value to prepend to the derived secret before hashing.

secretAppend
Byte[]

在进行哈希算法之前,要追加到派生密钥的值。A value to append to the derived secret before hashing.

返回

Byte[]

来自与另一方的公钥进行密钥交换的密钥材料。The key material from the key exchange with the other party's public key.

异常

派生方法必须重写此方法。A derived class must override this method.

otherPartyPublicKey 在与此密钥不同的曲线上。otherPartyPublicKey is over a different curve than this key.

适用于