简体   繁体   中英

ASN.1 file parser / Compiler using java

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.

对于上述问题,我已在以下链接中回答: http://stackoverflow.com/questions/35924703/bouncy-castle-example-for-encoding-cdr/36496740#36496740

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM