MDER is specified using ITU-T X.208, which uses a two-phase
method for encoding and decoding ANY DEFINED BY
types. These
types are used to allow flexibility in message transmission by specifying
a "hole" in a message to be filled in by a type specified by an object
identifier.
Let us assume for sake of example that we wish to transmit a message that has a generic header and a payload defined by some object identifier. We must first encode the payload and attach it to the message. Then we can encode the whole message and transmit it. Because this takes two steps, we call this two-phase encoding.
The inverse holds for decoding. The whole message is first decoded. The payload may then be identified and decoded according to its specific type.
This section describes how to perform two-phase encoding and decoding using the MDER Run Time Library. Examples are also provided in the distribution.