ECDiffieHellman.DeriveKeyMaterial(ECDiffieHellmanPublicKey) 方法

定义

在派生类中实现时,对共享机密执行密钥派生。When implemented in a derived class, performs a key derivation on the shared secret.

public:
 virtual cli::array <System::Byte> ^ DeriveKeyMaterial(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey);
public:
 abstract cli::array <System::Byte> ^ DeriveKeyMaterial(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey);
public virtual byte[] DeriveKeyMaterial (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);
public abstract byte[] DeriveKeyMaterial (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);
abstract member DeriveKeyMaterial : System.Security.Cryptography.ECDiffieHellmanPublicKey -> byte[]
override this.DeriveKeyMaterial : System.Security.Cryptography.ECDiffieHellmanPublicKey -> byte[]
abstract member DeriveKeyMaterial : System.Security.Cryptography.ECDiffieHellmanPublicKey -> byte[]
Public Overridable Function DeriveKeyMaterial (otherPartyPublicKey As ECDiffieHellmanPublicKey) As Byte()
Public MustOverride Function DeriveKeyMaterial (otherPartyPublicKey As ECDiffieHellmanPublicKey) As Byte()

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

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

返回

Byte[]

使用共享机密作为输入的密钥派生功能的结果。The result of the key derivation function, using the shared secret as an input.

例外

otherPartyPublicKey 使用的曲线的大小与此密钥使用的曲线不同。The curve used by otherPartyPublicKey has a different size than the curve from this key.

otherPartyPublicKeynullotherPartyPublicKey is null.

otherPartyPublicKey使用的曲线与此密钥使用的曲线不同。The curve used by otherPartyPublicKey is different than the curve from this key.

- 或 --or-

此实例仅表示一个公钥。This instance represents only a public key.

注解

此方法的默认行为等效于将 DeriveKeyFromHash SHA-256 指定为不带预置值或追加值的哈希算法。The default behavior of this method is equivalent to calling DeriveKeyFromHash specifying SHA-256 as the hash algorithm with no prepend or append values. 某些实现允许更改此方法的行为,并建议调用方调用任何方法,以显式指示它执行所需的密钥派生。Some implementations allow the behavior of this method to be changed, and callers are advised to call whichever method explicitly says it performs the key derivation they need.

适用于