Skip to Content
Programming .NET Security
book

Programming .NET Security

by Adam Freeman, Allen Jones
June 2003
Intermediate to advanced
714 pages
22h 8m
English
O'Reilly Media, Inc.
Content preview from Programming .NET Security

Name

IStackWalk

Synopsis

public interface IStackWalk {
// Public Instance Methods
   public void Assert(  );
   public void Demand(  );
   public void Deny(  );
   public void PermitOnly(  );
}

Permission classes that use stack walks to resolve security demands implement the IStackWalk interface. These include the PermissionSet class, as well as the CodeAccessPermission class, from which all standard code-access and identity permissions inherit.

IStackWalk defines the Demand( ) method, which duplicates the method of the same name defined in the IPermission interface. However, the IStackWalk.Demand( ) method initiates a stack-walk-based security demand, whereas IPermission.Demand( ) is not intended to use the call stack to resolve security demands. The Assert( ), Deny( ), and PermitOnly( ) methods annotate the call stack frame of the code from which they are executed, and affect the stack walk process initiated by a Demand( ) call.

Assert( ) allows code to vouch for the permissions of the callers above it on the call stack. During a stack walk, if a demanded permission matches, or is a subset of, the asserted permission, the stack walk terminates successfully without evaluating further stack frames. If the asserted permissions provide only a partial match of those demanded, the stack walk continues but only for the remaining unasserted permissions. Code must have been granted a permission in order to assert it, and the code must have the permission to assert defined by the System.Security.Permissions.SecurityPermission ...

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.
Start your free trial

You might also like

.NET Framework Security

.NET Framework Security

Brian A. LaMacchia, Sebastian Lange, Matthew Lyons, Rudi Martin, Kevin T. Price
.NET Security and Cryptography

.NET Security and Cryptography

Peter Thorsteinson, G. Gnana Arun Ganesh
ASP.NET Core Security

ASP.NET Core Security

Christian Wenz

Publisher Resources

ISBN: 0596004427Supplemental ContentErrata Page