SafeCTLHandleContext Class |
SafeCTLHandleContext provides a SafeHandle class for an X509CTL context as stored in its Handle property. 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 extension method.
Namespace: System.Security.Cryptography.X509Certificates
The SafeCTLHandleContext type exposes the following members.
Name | Description | |
---|---|---|
IsClosed | Gets a value indicating whether the handle is closed. (Inherited from SafeHandle.) | |
IsInvalid | Gets a value that indicates whether the handle is invalid. (Inherited from SafeHandleZeroOrMinusOneIsInvalid.) |
Name | Description | |
---|---|---|
Close | Marks the handle for releasing and freeing resources. (Inherited from SafeHandle.) | |
DangerousAddRef | Manually increments the reference counter on SafeHandle instances. (Inherited from SafeHandle.) | |
DangerousGetHandle | Returns the value of the handle field. (Inherited from SafeHandle.) | |
DangerousRelease | Manually decrements the reference counter on a SafeHandle instance. (Inherited from SafeHandle.) | |
Dispose | Releases all resources used by the SafeHandle class. (Inherited from SafeHandle.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
SetHandleAsInvalid | Marks a handle as no longer used. (Inherited from SafeHandle.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Permission | Description |
---|---|
System.Security.PermissionsSecurityPermission | The immediate caller must have SecurityPermission/UnmanagedCode to use this type. |