Flashcards
CAS - Code Access Security
Cards in this deck (13)
- 1What does the CAS mean?CAS stands for Code Access Security
- 2What is the CAS Namespace?System.Security.CodeAccessPermission
- 3What are the two ways of implementing CAS?Declarative: Using attributes on the code
Imperative: Explicitly calling the CAS methods on the code. - 4What is a Type-Safe code?Type-safe code is code that accesses types only in well-defined, allowable ways.
- 5How the type-safe is verified?By the JIT(just-in-time) compilation.
- 6Is it possible to run code without type-safe verification?It's possible, but it's required a verification byass.
- 7What is the tool that checks if the code type-safe?Peverify.exe
- 8Where the declarative security syntax attributes are placed?On assemblies, classes, methods and field members.
- 9What are the common forms of permission that you have in CAS(declarative)?SecurityAction.Demand - Permission required to all callers on the stack.
SecurityAction.Assert - Permission required from on caller.
SecurityAction.LinkDemand - Permission required from the direct caller
SecurityAction.PermitOnly - Permission granted to specific resources
SecurityAction.InheritanceDemand - derived class inherit permission - 10What are the steps to create a customized permission class?1. Design the Permission class
2. Implement the IPermission and IUnrestrictedPermission Interfaces
3. Implement CodeAccessSecurityAttribute for declarative usage.
OR
Inherit the class CodeAccessPermission, that implments all the interfaces required. - 11What are possible forms of permission of the CodeAccessPermission class?Assert()
Demand()
Deny()
PermitOnly()
The methods below, causes all/deny/assert/permitonly previous overrides for the current frame to be removed
RevertAll()
RevertDeny()
RevertPermitOnly()
RevertAssert() - 12What are the identity and principal objects?The identity stores information about the user's identity and principal the roles assigned to the user.
- 13How to get the current user role?By getting information on the Principal object.
Information
- Description
- Flashcards on CAS - Code Access Security, created by Thiago Avelino on 10/01/2016.
- Created by
- Thiago Avelino
- Views
- 1
- Tags
- Rating