directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: ASN.1 tools (snicker?) question...
Date Thu, 12 May 2005 18:01:47 GMT
> >Today we have a hand coded BER decoder. I would like to have a real compiler + codec
when we're now looking at enhancing this functionality and of course not pay an arm and leg
for it.
> >  
> >
> Are you sure ? I've written quite a bit of BER code and I much prefer 
> the hand-built approach.

I must admit that the complexity of writing an ASN.1 decoder relies on
the states automaton you have to implement. If it's a really simple
grammar, using a compiler is not a must. Your grammar is really simple.
SPNEGO is a little bit more complicated, because you have all those
optional fields. LDAP is very complicated, but can be cut in little
pieces (I've spent much more time to implement the SPNEGO coder than the
LdapResponse coder...)

Whatever, you may perfectly use the runtime, which read the PDU and
callback the grammar's action on Tag, Length and Value events. If you
look at the Sandbox sub-project (sandbox/trunk/asn1-new-codec/), you
will find two subdirectories :
src/java/org/apache/asn1/ldap and

which contain code to decode LDAP and SPNEGO PDU. They are not finished
yet, but the structure will not change a lot. It may be a good start for
your project.

If you need any explanation about it, feel free to ask...

Emmanuel L├ęcharny

View raw message