summaryrefslogtreecommitdiff
path: root/src/mscorlib/shared/System/Security/SecurityCriticalAttribute.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/shared/System/Security/SecurityCriticalAttribute.cs')
-rw-r--r--src/mscorlib/shared/System/Security/SecurityCriticalAttribute.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mscorlib/shared/System/Security/SecurityCriticalAttribute.cs b/src/mscorlib/shared/System/Security/SecurityCriticalAttribute.cs
new file mode 100644
index 0000000000..2bf1700afb
--- /dev/null
+++ b/src/mscorlib/shared/System/Security/SecurityCriticalAttribute.cs
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Security
+{
+ // SecurityCriticalAttribute
+ // Indicates that the decorated code or assembly performs security critical operations (e.g. Assert, "unsafe", LinkDemand, etc.)
+ // The attribute can be placed on most targets, except on arguments/return values.
+ [AttributeUsage(AttributeTargets.Assembly |
+ AttributeTargets.Class |
+ AttributeTargets.Struct |
+ AttributeTargets.Enum |
+ AttributeTargets.Constructor |
+ AttributeTargets.Method |
+ AttributeTargets.Field |
+ AttributeTargets.Interface |
+ AttributeTargets.Delegate,
+ AllowMultiple = false,
+ Inherited = false)]
+ public sealed class SecurityCriticalAttribute : Attribute
+ {
+#pragma warning disable 618 // We still use SecurityCriticalScope for v2 compat
+ public SecurityCriticalAttribute() { }
+
+ public SecurityCriticalAttribute(SecurityCriticalScope scope)
+ {
+ Scope = scope;
+ }
+
+ [Obsolete("SecurityCriticalScope is only used for .NET 2.0 transparency compatibility.")]
+ public SecurityCriticalScope Scope { get; }
+#pragma warning restore 618
+ }
+}
+