Summary

.NET offers two types of security mechanisms—CAS and role-based security. These security mechanisms are defined on top of the security mechanism offered by the underlying OS.

CAS grants code access permissions to an assembly based on certain evidence about the origin or author of the assembly. The .NET Framework defines various code access permissions such as reading or writing files, changing environmental variables, displaying dialog boxes, and so on. The standard classes under .NET that deal with any security-sensitive operations are designed to perform the appropriate security check. If the assembly does not have the needed permissions, the security mechanism throws an exception of type SecurityException.

By default, the security ...

Get .NET Programming: A Practical Guide Using C# 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.