Imperative Versus Declarative CAS


Just as we saw in the previous chapter on user-based security, CAS can also be implemented in either an imperative or a declarative manner. We will also see shortly that, just as was the case in user -based security, imperative CAS can be implemented using two slightly different approaches.

The first of these imperative approaches involves the explicit use of the Evidence class. This approach is sometimes referred to as explicit evidence-based security, because you explicitly evaluate host and assembly security evidence in making programmatic decisions. The other imperative approach makes use of various permission classes, derived from CodeAccessPermission , that automatically throw a SecurityException where appropriate. In a later section, we will also see how to implement CAS in a declarative way by making use of permission attributes applied to methods , classes, and assemblies.



.NET Security and Cryptography
.NET Security and Cryptography
ISBN: 013100851X
EAN: 2147483647
Year: 2003
Pages: 126

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