SecurityRulesAttribute.cs 1.2 KB

12345678910111213141516171819202122232425262728
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Security
  5. {
  6. // SecurityRulesAttribute
  7. //
  8. // Indicates which set of security rules an assembly was authored against, and therefore which set of
  9. // rules the runtime should enforce on the assembly. For instance, an assembly marked with
  10. // [SecurityRules(SecurityRuleSet.Level1)] will follow the v2.0 transparency rules, where transparent code
  11. // can call a LinkDemand by converting it to a full demand, public critical methods are implicitly
  12. // treat as safe, and the remainder of the v2.0 rules apply.
  13. [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
  14. public sealed class SecurityRulesAttribute : Attribute
  15. {
  16. public SecurityRulesAttribute(SecurityRuleSet ruleSet)
  17. {
  18. RuleSet = ruleSet;
  19. }
  20. // Should fully trusted transparent code skip IL verification
  21. public bool SkipVerificationInFullTrust { get; set; }
  22. public SecurityRuleSet RuleSet { get; }
  23. }
  24. }