O'Reilly logo

Improving Web Application Security: Threats and Countermeasures by Microsoft Corporation

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary of Steps

This How To includes the following steps:

  1. Create the EncryptionPermission class.

  2. Create the EncryptionPermissionAttribute class.

  3. Install the Permission assembly in the global assembly cache (GAC).

  4. Update the DPAPI managed wrapper code.

  5. Call DPAPI from a medium trust Web application.

Step 1. Create the EncryptionPermission Class

The EncryptionPermission class is the custom permission implementation used to authorize access to the unmanaged DPAPI functionality.

▸ To create the CustomPermission class

  1. Create a new Visual C#™ development tool Class Library project CustomPermission, and rename class1.cs to EncryptionPermission.cs.

  2. Add a strong name to the assembly so that you can install it in the GAC. Use the following attribute in assemblyinfo.cs ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required