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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access