SafeCTLHandleContext Class

SafeCTLHandleContext provides a SafeHandle class for an X509CertificateTrustList context. This can be used instead of the raw IntPtr to avoid races with the garbage collector, ensuring that the X509Certificate object is not cleaned up from underneath you while you are still using the handle pointer.

This safe handle type represents a native CTL_CONTEXT.

A SafeCTLHandleContext for an X509CTL can be obtained by calling the GetSafeContext(X509CertificateTrustList) extension method.

Definition

Namespace: SysadminsLV.PKI.Cryptography.X509Certificates
Assembly: SysadminsLV.PKI.Win (in SysadminsLV.PKI.Win.dll) Version: 4.0.1.0 (4.0.1.0)
C#
public sealed class SafeCTLHandleContext : SafeHandleZeroOrMinusOneIsInvalid
Inheritance
Object    CriticalFinalizerObject    SafeHandle    SafeHandleZeroOrMinusOneIsInvalid    SafeCTLHandleContext

Properties

Methods

Close
(Inherited from SafeHandle)
DangerousAddRef
(Inherited from SafeHandle)
DangerousGetHandle
(Inherited from SafeHandle)
DangerousRelease
(Inherited from SafeHandle)
Dispose
(Inherited from SafeHandle)
Equals
(Inherited from Object)
GetHashCode
(Inherited from Object)
GetType
(Inherited from Object)
SetHandleAsInvalid
(Inherited from SafeHandle)
ToString
(Inherited from Object)

.NET Framework Security

SecurityPermission The immediate caller must have SecurityPermission/UnmanagedCode to use this type.

See Also