SecurityCriticalAttribute
Class
Definition
Specifies that code or an assembly performs security-critical operations.
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple=false, Inherited=false)]
public sealed class SecurityCriticalAttribute : Attribute
- Inheritance
- Attributes
Inherited Members
System.Attribute
System.Object
Remarks
Security-critical operations are actions that affect code access security, such as elevation of privilege through suppression of code access security checks by using the Assert method, calling unsafe managed code, and so forth. Either the SecurityCriticalAttribute attribute or the SecuritySafeCriticalAttribute attribute must be applied to code for the code to perform security-critical operations.
Note
The SecurityCriticalAttribute is equivalent to a link demand for full trust. A type or member marked with the SecurityCriticalAttribute can be called only by fully trusted code; it does not have to demand specific permissions. It cannot be called by partially trusted code.
Applying the SecurityCriticalAttribute at the assembly level identifies the assembly as a security-critical assembly. The entire assembly can be identified as critical by setting the scope parameter SecurityCriticalScope.
Constructors
| SecurityCriticalAttribute() |
Initializes a new instance of the SecurityCriticalAttribute class. |
| SecurityCriticalAttribute(SecurityCriticalScope) |
Initializes a new instance of the SecurityCriticalAttribute class with the specified scope. |
Properties
| Scope |
Gets the scope for the attribute. |