> >Is there any way to prepending an ASN1 sequence?
>  
> Encoding backwards and then reversing the encoding is a standard trick for
> doing ASN.1.  The alternative is to do it in two passes, once to build up a
> tree containing the nested element sizes, the second time to do the encoding.

The third trick is to use indefinite length encoding, where the outer
element length is set to a special value meaning "unknown", a series of
elements are encoded, and then a marker is appended to designate the
end of the series.  Indefinite length encoding is optional in the Basic
Encoding Rules (BER), mandatory in the Canonical Encoding Rules (CER),
and prohibited in the Distinguished Encoding Rules (DER), so this method
is only usable in applications which do not require DER.
+-------------------------------------------------------------------------+
| Administrative requests should be sent to [EMAIL PROTECTED] |
| List service provided by Open Software Associates, http://www.osa.com/  |
+-------------------------------------------------------------------------+

Reply via email to