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

◆ GetECDiffieHellmanPublicKey()

ECDiffieHellman? System.Security.Cryptography.X509Certificates.PublicKey.GetECDiffieHellmanPublicKey ( )
inline

Definition at line 135 of file PublicKey.cs.

136 {
137 if (_oid.Value != "1.2.840.10045.2.1")
138 {
139 return null;
140 }
141 ECDiffieHellman eCDiffieHellman = ECDiffieHellman.Create();
142 try
143 {
144 eCDiffieHellman.ImportSubjectPublicKeyInfo(ExportSubjectPublicKeyInfo(), out var _);
145 return eCDiffieHellman;
146 }
147 catch
148 {
149 eCDiffieHellman.Dispose();
150 throw;
151 }
152 }

References System.Security.Cryptography.X509Certificates.PublicKey._oid, System.Security.Cryptography.ECDiffieHellman.Create(), System.Security.Cryptography.AsymmetricAlgorithm.Dispose(), System.Security.Cryptography.X509Certificates.PublicKey.ExportSubjectPublicKeyInfo(), System.Security.Cryptography.ECDiffieHellman.ImportSubjectPublicKeyInfo(), and System.Security.Cryptography.Oid.Value.