This extensibility is achieved through the use of object identifiers (OID), encoding types, and associated DLLs. In the CryptoAPI, an OID can take any of the following forms:
The functions that can have their functionality extended (those that can accept OID and encoding type arguments), search the system registry in an attempt to find a DLL associated with the OID that was passed to the function. If found, the function loads the DLL and calls the function. The following illustration shows this flow for the CryptEncodeObject function:
This extensibility allows Microsoft, and others, to extend the functionality of the CryptoAPI as the need arises. However, if this methodology is used, a burden is placed on the developer to write all the necessary code to complete the new functionality. For example, if you wanted to encode some new data structure, the new function would have to perform the entire encoding process from beginning to end. This is not a trivial task.