Understanding the System.Security. Policy Namespace


Understanding the System.Security. Policy Namespace

Most developers are already familiar with some policy concepts. For example, most developers know that a policy defines a set of rules for access to a resource. A user might have read access to a file, but not write access. Consequently, you expect to see classes such as PolicyException, PolicyLevel, and PolicyStatement in the System.Security.Policy namespace.

Network administrators manage policies at the enterprise, machine, and user levels in most cases. Standard additions to these levels include an application and domain level. However, it’s possible that a network administrator could require other levels, such as a workgroup.

The concept of a policy extends beyond a set of rules in .NET, however. When an entity requests access to a resource, it must present evidence that the security system allows access. The System.Security.Policy namespace supplies a number of classes that present or manage various kinds of evidence. For example, the StrongName class presents the strong name of an assembly as evidence. The strong name is important because it uniquely identifies the assembly, provides a hash value for assembly verification, and tells who created the assembly.

Tip

You can find a complete description of the System.Security.Policy namespace at http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemSecurityPolicy.asp. Pay particular attention to the classes that affect how a program, administrator, or other entity can make policies, because these classes will likely change most as the .NET Framework security matures. Unlike other namespaces with a lot of classes, these aren’t that easy to group by type, so you’ll need to look at each class individually to ensure your program makes the best use possible of the features in this namespace.

You need policies to perform a variety of tasks. See Listing 2.2 for an example of how to use this namespace. This example starts at the beginning by showing the policy hierarchy on the local machine.




.Net Development Security Solutions
.NET Development Security Solutions
ISBN: 0782142664
EAN: 2147483647
Year: 2003
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net