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

◆ FromHandle()

static ICertificatePal Internal.Cryptography.Pal.CertificatePal.FromHandle ( IntPtr handle)
inlinestatic

Definition at line 261 of file CertificatePal.cs.

262 {
263 if (handle == IntPtr.Zero)
264 {
265 throw new ArgumentException(System.SR.Arg_InvalidHandle, "handle");
266 }
267 SafeCertContextHandle safeCertContextHandle = global::Interop.crypt32.CertDuplicateCertificateContext(handle);
268 if (safeCertContextHandle.IsInvalid)
269 {
270 throw (-2147024890).ToCryptographicException();
271 }
272 int pcbData = 0;
274 bool deleteKeyContainer = global::Interop.crypt32.CertGetCertificateContextProperty(safeCertContextHandle, CertContextPropId.CERT_CLR_DELETE_KEY_PROP_ID, out pvData, ref pcbData);
276 }
static string Arg_InvalidHandle
Definition SR.cs:14
Definition SR.cs:7
static readonly IntPtr Zero
Definition IntPtr.cs:18

References Internal.Cryptography.Pal.CertificatePal.CertificatePal(), System.SR.Arg_InvalidHandle, System.handle, and System.IntPtr.Zero.

Referenced by System.Security.Cryptography.X509Certificates.X509Certificate.X509Certificate(), and Internal.Cryptography.Pal.FindPal.VerifyCertificateIgnoringErrors().