Openspruce Java ASN.1 BER compiler and decodr?

Caporegime
Joined
18 Oct 2002
Posts
32,623
I need to be able to decode a data stream encoded with the ASN.1 BER standard. The notation uses automatic tags but it seems like most of the open source compilers don't support that.

I've tried jANS1 and JAC so far to no avail. Any other suggestions? I know there are some commercial decoders available for around $1000, the money isn't a problem but we prefer to keep things open source.
 
Soldato
Joined
1 Mar 2003
Posts
5,508
Location
Cotham, Bristol
I've been working with LDAP classes recently, I believe that encodes and decodes using BER?

There is a com.sun.jndi.ldap.BerDecoder and BerEncoder, would those be of any interest to you?
 
Caporegime
OP
Joined
18 Oct 2002
Posts
32,623
Thanks guys. I looked at these 2 before but they are fairly limited as far as I can tell, especially the LDAP code. Libraries like jASN1 allow you to compile the notation into java classes and then serial the encoded byte stream straight into java classes, which is really neat and fast to develop. bouncy castle allows you to parse the encoded stream but you have to explicitly control the decoding into the various fields, e.g. you gave to know the next element is an Integer, the next a Sequence of MyType etc.

This is probably what i am going to have to end up using though. I'm also not sure if bouncy castle can handle automatic tagging which would make it useless.



I'm just so surprised support for ASN1 is so limited.
 
Soldato
Joined
23 Feb 2009
Posts
4,976
Location
South Wirral
ASN.1 is pretty old and like most ITU standards, downright horrible. You usually have a grammar associated with whatever is encoded (a MIB) so you know what should be coming next.

Only other thought would be SNMP libararies.
 
Back
Top Bottom