ECDiffieHellmanCng.DeriveSecretAgreementHandle 方法

定义

获取双方之间生成的机密协议的一个句柄。

重载

DeriveSecretAgreementHandle(ECDiffieHellmanPublicKey)

在给定包含另一方公钥的 ECDiffieHellmanPublicKey 对象的情况下,获取双方之间生成的机密协议的句柄。

DeriveSecretAgreementHandle(CngKey)

在给定包含另一方公钥的 CngKey 对象的情况下,获取双方之间生成的机密协议的句柄。

注解

方法 DeriveSecretAgreementHandle 重载适用于需要处理原始机密协议而不是密钥材料的高级用户。 机密协议句柄可用于平台调用中,以执行类未包装 ECDiffieHellmanCng 的任何工作。

DeriveSecretAgreementHandle(ECDiffieHellmanPublicKey)

在给定包含另一方公钥的 ECDiffieHellmanPublicKey 对象的情况下,获取双方之间生成的机密协议的句柄。

public:
 Microsoft::Win32::SafeHandles::SafeNCryptSecretHandle ^ DeriveSecretAgreementHandle(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey);
public Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle DeriveSecretAgreementHandle (System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey);
member this.DeriveSecretAgreementHandle : System.Security.Cryptography.ECDiffieHellmanPublicKey -> Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle
Public Function DeriveSecretAgreementHandle (otherPartyPublicKey As ECDiffieHellmanPublicKey) As SafeNCryptSecretHandle

参数

otherPartyPublicKey
ECDiffieHellmanPublicKey

密钥交换中另一方的公钥。

返回

SafeNCryptSecretHandle

一个机密协议的句柄。 此信息是从当前对象的私钥和指定的公钥计算得到的。

例外

otherPartyPublicKeynull

otherPartyPublicKey 不是 ECDiffieHellmanPublicKey 密钥。

适用于

DeriveSecretAgreementHandle(CngKey)

在给定包含另一方公钥的 CngKey 对象的情况下,获取双方之间生成的机密协议的句柄。

public:
 Microsoft::Win32::SafeHandles::SafeNCryptSecretHandle ^ DeriveSecretAgreementHandle(System::Security::Cryptography::CngKey ^ otherPartyPublicKey);
public Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle DeriveSecretAgreementHandle (System.Security.Cryptography.CngKey otherPartyPublicKey);
[System.Security.SecurityCritical]
public Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle DeriveSecretAgreementHandle (System.Security.Cryptography.CngKey otherPartyPublicKey);
member this.DeriveSecretAgreementHandle : System.Security.Cryptography.CngKey -> Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle
[<System.Security.SecurityCritical>]
member this.DeriveSecretAgreementHandle : System.Security.Cryptography.CngKey -> Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle
Public Function DeriveSecretAgreementHandle (otherPartyPublicKey As CngKey) As SafeNCryptSecretHandle

参数

otherPartyPublicKey
CngKey

一个对象,它包含来自密钥交换中另一方的椭圆曲线 Diffie-Hellman (ECDH) 密钥的公共部分。

返回

SafeNCryptSecretHandle

一个机密协议的句柄。 此信息是从当前对象的私钥和指定的公钥计算得到的。

属性

例外

otherPartyPublicKeynull

otherPartyPublicKey 不是 ECDH 密钥,或者大小不正确。

所有其他错误。

适用于