1

I am new to ASN.1 syntax and what i want is a ASN.1 compiler which parse the ASN.1 syntax and generate .java files. I googled for the same thing and got few solution but thous are not working well (Or they are capable of parsing very specific syntax and generate java files)

  1. This link is working for some extent
  2. This link is capable of generating few files

Is there any source which parse advanced syntax Or all the content of ASN.1 and generate java files..?

How i suspect above links are working for some extent ?

First i checked whether ASN.1 file is proper / valid by using ASN.1 play ground ( OSS Nokalva), then by using above source code i have parsed ASN.1 file and able to generate around 195 files.

But the generated files are having some error like few of them didn't contain encode / decode method, some java classes are extended with other supper classes which are not generated at all (Even though ASN.1 file contain a description about thous supper classes).

So, by using same ASN.1 file and with the help of this site i have generated C files then it generated around 456 files [228 are header files and 228 are .c files] which contain all the non generated supper class files of java with proper encode / decode method with value can be set using constructors.

i have gone through Bouncy Castle but i didn't find any clue about parsing ASN.1 file to generate java files.

But after gone through few links i felt Bouncy Castle is a algorithm based java code to encode / decode the string values and more specifically Bouncy castle is a API which strongly support for encryption / decryption for security purpose like creating SSL and it also include ASN.1 syntax support, it provide high end Interfaces / Classes like BER/PER/DER etc. parser but we need to write the supporting classes by referring ASN.1 syntax and there is no proper information / clue / white paper. so far i have this link to work with Bouncy Castle (If i am wrong pleas make me understand).

Why i want to generate java files..?

I already have Encoded files (CDRs) which encoded using ASN.1 file syntax, so if i get java files then i can decode thous files to get required information.

____________________________Or____________________________________

How can i write my own JAVA Encode / Decode methods by referring ASN.1 syntax file and with the help of Bouncy Castle API.

So far i have not seen any open source example / code snippets which demonstrate the way of mapping / writing / simple example to create encode or decode methods in java using ASN.1 syntax file.

any help will be appreciated, Thanks.

Rajesh Hatwar
  • 1,843
  • 6
  • 39
  • 58
  • There are few things which are not clear from your post. First, asn1-playgrund.oss.com does not allow you to download the generated java files. Actually, it does not even ask you which kind of code you want to generate. Then you say that you generated C code which contain generated supper class files. It is not clear what you mean since the C language does not have the "class" concept. – Andrei Bozantan Feb 25 '16 at 13:06
  • @bosonix No it is not like that. i got set of java compiler which can parse the ASN.1 syntax and able to generate .java files, but generated java files was not proper so just i wanted to verify / crosscheck whether the ASN.1 fie is proper / valid / good enough to feed proper information to the compiler. So i used C compiler to check ASN.1 fie is proper / valid. – Rajesh Hatwar Feb 26 '16 at 08:50
  • Now with the help of " OSS Nokalva " java tool i able to generate all JAVA files. I already have the encoded CDRs file (.dat file with ) using ASN.1 syntax, so now i am looking for how to decode the CDRs file – Rajesh Hatwar Feb 26 '16 at 08:58
  • I used "asn1-playgrund.oss.com" to validate / to check syntax of ASN.1 – Rajesh Hatwar Feb 26 '16 at 09:00
  • OSS Nokalva is an online schema checker/compiler and data encoder/decoder – Rajesh Hatwar Feb 26 '16 at 09:08
  • Thanks for the link, after spending some time on Bouncy castle API i have understood for some extant and got fully satisfactory result. for free of cost...!!!! – Rajesh Hatwar Apr 12 '16 at 10:05

1 Answers1

0

For the above question i have answered in following link http://stackoverflow.com/questions/35924703/bouncy-castle-example-for-encoding-cdr/36496740#36496740

Rajesh Hatwar
  • 1,843
  • 6
  • 39
  • 58