Decoding a Series of Messages Using the C Decode Functions

Decoding a series of messages is very similar to the method used for other encoding rules. MDER, however, is simpler. Users need not concern themselves with idiosyncrasies like byte alignment or length markers.

Short pseudo-code is shown below. As in the encoding example, rtxMemReset is used at the end of the loop to avoid allocating new memory for dynamic data structures. This helps to improve performance.

   /* initialize context, et c. */   
   for ( ; ; ) {
      /* initialize data structure */
      
      /* call MDERDec_<name> function */
      
      /* perform operations on decoded structure */
      
      /* reset memory: */
      stat = rtxMemReset (&ctxt);
   }

More details may be found in the sample programs included in the ASN1C software development kit.