ECDiffieHellman.DeriveKeyFromHash 方法

定义

使用指定的哈希算法执行密钥派生。

重载

名称 说明
DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

使用指定的哈希算法执行密钥派生。

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

在派生类中实现时,使用具有可选追加或追加数据的指定哈希算法执行密钥派生。

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

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

使用指定的哈希算法执行密钥派生。

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

另一方的公钥。

hashAlgorithm
HashAlgorithmName

用于派生密钥材料的哈希算法。

返回

Byte[]

共享机密的哈希。

例外

使用的 otherPartyPublicKey 曲线的大小与此键中的曲线不同。

-或-

hashAlgorithm 参数未指定哈希。

otherPartyPublicKeynull

使用的 otherPartyPublicKey 曲线不同于此键的曲线。

-或-

此实例仅表示公钥。

注解

此重载调用 DeriveKeyFromHash 作为前面和追加值传递 null 的方法。

适用于

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

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

在派生类中实现时,使用具有可选追加或追加数据的指定哈希算法执行密钥派生。

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

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

另一方的公钥。

hashAlgorithm
HashAlgorithmName

用于派生密钥材料的哈希算法。

secretPrepend
Byte[]

要在哈希之前追加到派生机密的值。

secretAppend
Byte[]

要在哈希之前追加到派生机密的值。

返回

Byte[]

在请求追加或追加数据后共享机密的哈希。

例外

派生类必须重写此方法。

使用的 otherPartyPublicKey 曲线的大小与此键中的曲线不同。

-或-

hashAlgorithm 参数未指定哈希。

otherPartyPublicKeynull

使用的 otherPartyPublicKey 曲线不同于此键的曲线。

-或-

此实例仅表示公钥。

注解

此方法在内部执行椭圆曲线 Diffie-Hellman 密钥协议以生成共享机密(z)。 此方法的返回值是使用指定的哈希算法的结果 HASH(secretPrepend || z || secretAppend) ,其中 || 表示串联。

如果值为或secretPrependsecretAppendnull数组,则它们被视为空数组。

适用于