Code Access Security

Code access security protects managed resources in the runtime from unrestrained code access. In other words, developers can specifically identify which resources can and cannot be accessed by a particular body of code. Code access security can operate at a more granular level than simple security policies in that it can be enforced at the class level or at the class member level, in addition to the assembly level.

Code access security checks are said to happen declaratively or imperatively, and there are two mirrored sets of permission classes that allow this to happen. For imperative security, you would use the core permission class specific to the resource you are interested in. For example, if you want to specify security ...

Get Visual Basic® Programmer's Guide to the .NET Framework Class Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.