Modifying the Cryptography Application Block

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The Cryptography Application Block was designed to be used in a variety of applications and to be a general-purpose cryptography application block. Extension points let you adapt the application block to suit the requirements of any particular application. However, if you want to add new features to the application block, you can do so by modifying the source code (the application block includes both the source code and the binaries).

Note

When modifying the source code, you should following the best practices described in Guidelines for Modifying the Application Blocks.

Modifying the Key Management Code

Enterprise Library implements a DPAPI-based approach to key management. You can use this implementation, or you can follow its model and adapt the code to meet the key management requirements of your organization. Use the following guidelines to modify the application block source code to implement a custom key management solution:

  • Modify the KeyManager class. The application block runtime uses the KeyManager class to read and write keys. This class is located in the Security.Cryptography project.
  • Modify or replace the Cryptographic Key Wizard source code. This wizard is a part of the application block design-time component. You can find the source code for the wizard in the Security.Cryptography.Configuration.Design project.
  • Modify the design-time source code that executes the Cryptographic Key Wizard. The configuration tools execute this wizard when you add a keyed hash algorithm provider or add a symmetric algorithm provider to your application configuration. You can find the code that executes the wizard in the AddHashAlgorithmProviderNodeCommand class and the AddSymmetricAlgorithmProviderNodeCommand class. You can find the source code for these classes in the Security.Cryptography.Configuration.Design project.

More Information

For related information, see the following resources: