Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DeriveSecretAgreementHandle() [2/2]

SafeNCryptSecretHandle System.Security.Cryptography.ECDiffieHellmanCng.DeriveSecretAgreementHandle ( ECDiffieHellmanPublicKey otherPartyPublicKey)
inline

Definition at line 292 of file ECDiffieHellmanCng.cs.

293 {
294 if (otherPartyPublicKey == null)
295 {
296 throw new ArgumentNullException("otherPartyPublicKey");
297 }
298 if (otherPartyPublicKey is ECDiffieHellmanCngPublicKey eCDiffieHellmanCngPublicKey)
299 {
300 using CngKey otherPartyPublicKey2 = eCDiffieHellmanCngPublicKey.Import();
301 return DeriveSecretAgreementHandle(otherPartyPublicKey2);
302 }
303 ECParameters parameters = otherPartyPublicKey.ExportParameters();
304 using ECDiffieHellmanCng eCDiffieHellmanCng = new ECDiffieHellmanCng();
305 eCDiffieHellmanCng.ImportParameters(parameters);
306 ECDiffieHellmanCngPublicKey eCDiffieHellmanCngPublicKey2;
307 using (eCDiffieHellmanCngPublicKey2 = (ECDiffieHellmanCngPublicKey)eCDiffieHellmanCng.PublicKey)
308 {
309 using CngKey otherPartyPublicKey3 = eCDiffieHellmanCngPublicKey2.Import();
310 return DeriveSecretAgreementHandle(otherPartyPublicKey3);
311 }
312 }
SafeNCryptSecretHandle DeriveSecretAgreementHandle(ECDiffieHellmanPublicKey otherPartyPublicKey)

References System.Security.Cryptography.ECDiffieHellmanCng.ECDiffieHellmanCng(), System.Security.Cryptography.ECDiffieHellmanCng.DeriveSecretAgreementHandle(), System.Security.Cryptography.ECDiffieHellmanPublicKey.ExportParameters(), System.Security.Cryptography.ECDiffieHellmanCngPublicKey.Import(), and System.Security.Cryptography.CngKey.Import().

Referenced by System.Security.Cryptography.ECDiffieHellmanCng.DeriveKeyFromHash(), System.Security.Cryptography.ECDiffieHellmanCng.DeriveKeyFromHmac(), System.Security.Cryptography.ECDiffieHellmanCng.DeriveKeyMaterial(), System.Security.Cryptography.ECDiffieHellmanCng.DeriveKeyTls(), and System.Security.Cryptography.ECDiffieHellmanCng.DeriveSecretAgreementHandle().