Partager via


Extending and Modifying the Cryptography Application Block

In its original state, the Cryptography Application Block works well for typical cryptography scenarios. However, there may be times when you have to customize some of the block's behavior to better suit your application's particular requirements. There are two ways to customize the block, extension and modification.

Extending the Cryptography Application Block

You extend the Cryptography Application Block through designated extension points. Typically, these extension points are custom classes, written by you, that implement a particular interface or derive from an abstract class. Because these custom classes exist in your application space, you do not have to modify or rebuild the block. Instead, you designate your extensions by using configuration settings.

You can extend the Cryptography Application Block by creating new cryptography providers in addition to those provided with the block. You do this by implementing the interfaces that are included with the block. To help you use custom providers, you can use the Enterprise Library configuration tools to specify custom hash and symmetric providers. For details, see Extending the Cryptography Application Block.

Modifying the Cryptography Application Block

You modify the Cryptography Application Block by making changes to the block source code. These changes may or may not require associated configuration changes. Because changes are made to the source code, you must rebuild the block before the modifications take effect. You must also be prepared to handle support and versioning issues. To learn more, see Modifying the Cryptography Application Block.