Aracılığıyla paylaş


Designing for Algorithm Abstraction

With the Cryptography Application Block, developers can refer to the algorithm to be used by the various methods by using logical names, such as "hash provider" or "password encryption."

Design Implications

The abstraction of the algorithm by logical naming implies two things about the block's design:

  • API support for logical names
  • Dependency on the Enterprise Library Core

API Support for Logical Names

Each CryptographyManager method accepts a string containing a logical algorithm name. The object uses this logical name to locate the appropriate algorithm information within the configuration file.

Dependency on Configuration

Because algorithm information is in a configuration file, the Cryptography Application Block must be able to read configuration information. As a result, the CryptographyManager class requires the Enterprise Library Core and uses it to locate and read the necessary information from the configuration file.