mscorlib(4.0.0.0) API with additions
System.Security.SecurityContext Class Reference

Encapsulates and propagates all security-related data for execution contexts transferred across threads. This class cannot be inherited. More...

Inheritance diagram for System.Security.SecurityContext:
[legend]
Collaboration diagram for System.Security.SecurityContext:
[legend]

Public Member Functions

void Dispose ()
 Releases all resources used by the current instance of the T:System.Security.SecurityContext class. More...
 
SecurityContext CreateCopy ()
 Creates a copy of the current security context. More...
 

Static Public Member Functions

static AsyncFlowControl SuppressFlow ()
 Suppresses the flow of the security context across asynchronous threads. More...
 
static AsyncFlowControl SuppressFlowWindowsIdentity ()
 Suppresses the flow of the Windows identity portion of the current security context across asynchronous threads. More...
 
static void RestoreFlow ()
 Restores the flow of the security context across asynchronous threads. More...
 
static bool IsFlowSuppressed ()
 Determines whether the flow of the security context has been suppressed. More...
 
static bool IsWindowsIdentityFlowSuppressed ()
 Determines whether the flow of the Windows identity portion of the current security context has been suppressed. More...
 
static void Run (SecurityContext securityContext, ContextCallback callback, object state)
 Runs the specified method in the specified security context on the current thread. More...
 
static SecurityContext Capture ()
 Captures the security context for the current thread. More...
 

Detailed Description

Encapsulates and propagates all security-related data for execution contexts transferred across threads. This class cannot be inherited.

Definition at line 12 of file SecurityContext.cs.

Member Function Documentation

◆ Capture()

static SecurityContext System.Security.SecurityContext.Capture ( )
static

Captures the security context for the current thread.

Returns
The security context for the current thread.

Definition at line 410 of file SecurityContext.cs.

◆ CreateCopy()

SecurityContext System.Security.SecurityContext.CreateCopy ( )

Creates a copy of the current security context.

Returns
The security context for the current thread.
Exceptions
T:System.InvalidOperationExceptionThe current security context has been previously used, was marshaled across application domains, or was not acquired through the M:System.Security.SecurityContext.Capture method.

Definition at line 370 of file SecurityContext.cs.

◆ Dispose()

void System.Security.SecurityContext.Dispose ( )

Releases all resources used by the current instance of the T:System.Security.SecurityContext class.

Implements System.IDisposable.

Definition at line 170 of file SecurityContext.cs.

◆ IsFlowSuppressed()

static bool System.Security.SecurityContext.IsFlowSuppressed ( )
static

Determines whether the flow of the security context has been suppressed.

Returns
true if the flow has been suppressed; otherwise, false.

Definition at line 227 of file SecurityContext.cs.

◆ IsWindowsIdentityFlowSuppressed()

static bool System.Security.SecurityContext.IsWindowsIdentityFlowSuppressed ( )
static

Determines whether the flow of the Windows identity portion of the current security context has been suppressed.

Returns
true if the flow has been suppressed; otherwise, false.

Definition at line 235 of file SecurityContext.cs.

◆ RestoreFlow()

static void System.Security.SecurityContext.RestoreFlow ( )
static

Restores the flow of the security context across asynchronous threads.

Exceptions
T:System.InvalidOperationExceptionThe security context is null or an empty string.

Definition at line 214 of file SecurityContext.cs.

◆ Run()

static void System.Security.SecurityContext.Run ( SecurityContext  securityContext,
ContextCallback  callback,
object  state 
)
static

Runs the specified method in the specified security context on the current thread.

Parameters
securityContextThe security context to set.
callbackThe delegate that represents the method to run in the specified security context.
stateThe object to pass to the callback method.
Exceptions
T:System.InvalidOperationExceptionsecurityContext is null.-or- securityContext was not acquired through a capture operation. -or- securityContext has already been used as the argument to a M:System.Security.SecurityContext.Run(System.Security.SecurityContext,System.Threading.ContextCallback,System.Object) method call.

Definition at line 260 of file SecurityContext.cs.

◆ SuppressFlow()

static AsyncFlowControl System.Security.SecurityContext.SuppressFlow ( )
static

Suppresses the flow of the security context across asynchronous threads.

Returns
An T:System.Threading.AsyncFlowControl structure for restoring the flow.

Definition at line 181 of file SecurityContext.cs.

◆ SuppressFlowWindowsIdentity()

static AsyncFlowControl System.Security.SecurityContext.SuppressFlowWindowsIdentity ( )
static

Suppresses the flow of the Windows identity portion of the current security context across asynchronous threads.

Returns
A structure for restoring the flow.

Definition at line 189 of file SecurityContext.cs.


The documentation for this class was generated from the following file: