ECDiffieHellmanCng.DeriveSecretAgreementHandle 方法

定义

获取双方之间生成的机密协议的一个句柄。Gets a handle to the secret agreement generated between two parties.

重载

DeriveSecretAgreementHandle(CngKey)

在给定包含另一方公钥的 CngKey 对象的情况下,获取双方之间生成的机密协议的句柄。Gets a handle to the secret agreement generated between two parties, given a CngKey object that contains the second party's public key.

DeriveSecretAgreementHandle(ECDiffieHellmanPublicKey)

在给定包含另一方公钥的 ECDiffieHellmanPublicKey 对象的情况下,获取双方之间生成的机密协议的句柄。Gets a handle to the secret agreement generated between two parties, given an ECDiffieHellmanPublicKey object that contains the second party's public key.

注解

DeriveSecretAgreementHandle方法重载适用于需要原始机密协议的句柄而不是密钥材料的高级用户。The DeriveSecretAgreementHandle method overloads are for advanced users who need a handle to the raw secret agreement instead of the key material. 机密协议句柄可用于平台调用调用, 以执行不是由ECDiffieHellmanCng类包装的任何工作。The secret agreement handle can be used in platform invoke calls to perform any work that is not wrapped by the ECDiffieHellmanCng class.

DeriveSecretAgreementHandle(CngKey)

在给定包含另一方公钥的 CngKey 对象的情况下,获取双方之间生成的机密协议的句柄。Gets a handle to the secret agreement generated between two parties, given a CngKey object that contains the second party's public key.

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
Public Function DeriveSecretAgreementHandle (otherPartyPublicKey As CngKey) As SafeNCryptSecretHandle

参数

otherPartyPublicKey
CngKey

一个对象,它包含来自密钥交换中另一方的椭圆曲线 Diffie-Hellman (ECDH) 密钥的公共部分。An object that contains the public part of the Elliptic Curve Diffie-Hellman (ECDH) key from the other party in the key exchange.

返回

一个机密协议的句柄。A handle to the secret agreement. 此信息是从当前对象的私钥和指定的公钥计算得到的。This information is calculated from the current object's private key and the specified public key.

属性

异常

otherPartyPublicKeynullotherPartyPublicKey is null.

otherPartyPublicKey 不是 ECDH 密钥,或者大小不正确。otherPartyPublicKey is not an ECDH key, or it is not the correct size.

所有其他错误。All other errors.

安全性

SecurityPermission
用于调用非托管代码的权限。for permission to call unmanaged code. 需求值: LinkDemandDemand value: LinkDemand. 关联的枚举:UnmanagedCodeAssociated enumeration: UnmanagedCode

DeriveSecretAgreementHandle(ECDiffieHellmanPublicKey)

在给定包含另一方公钥的 ECDiffieHellmanPublicKey 对象的情况下,获取双方之间生成的机密协议的句柄。Gets a handle to the secret agreement generated between two parties, given an ECDiffieHellmanPublicKey object that contains the second party's public key.

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

密钥交换中另一方的公钥。The public key from the other party in the key exchange.

返回

一个机密协议的句柄。A handle to the secret agreement. 此信息是从当前对象的私钥和指定的公钥计算得到的。This information is calculated from the current object's private key and the specified public key.

异常

otherPartyPublicKeynullotherPartyPublicKey is null.

otherPartyPublicKey 不是 ECDiffieHellmanPublicKey 密钥。otherPartyPublicKey is not an ECDiffieHellmanPublicKey key.

适用于