Parsing a DER encoded file

Hello,I would like to parse a DER encoded file ; can any one forward me on how to do that in java.best regards
[131 byte] By [hanane1a] at [2007-11-15]
# 1

> Hello,

> I would like to parse a DER encoded file ; can any

> one forward me on how to do that in java.

> best regards

I have found three ways of doing that...

1) you can get a DER Compiler and parse the file using that compiler. It will generate Java classes for you with encode and decode functions... the easiest compiler to use, that I came across is Objective Systems' ASN1C compiler...

2) the second way of doing it is through run time APIs... RSA's JsafeJCE provider has APIs for doing run time DER encoding and decoding based on user defined DER structure...

3) since DER does nothing but appends tag and data length information to the information you are trying to send, you can write your own code to encode and decode a DER stream...

hope this helps...

DarumAa at 2007-7-12 > top of java,Security,Cryptography...
# 2

Before going with 3), do check if any of the available implementations suite you. There are the Bouncy Castle Crypto APIs (http://www.bouncycastle.org/) which contain, among other things, a library for reading/writing ASN.1 objects (both DER and CER are ASN.1 encoded files)

Kind regards,

Anestis

mrAnesta at 2007-7-12 > top of java,Security,Cryptography...
# 3

> Before going with 3), do check if any of the

> available implementations suite you. There are the

> Bouncy Castle Crypto APIs

> (http://www.bouncycastle.org/) which contain, among

> other things, a library for reading/writing ASN.1

> objects (both DER and CER are ASN.1 encoded files)

>

> Kind regards,

> Anestis

I concur... use 3) only if 1) and 2) fail as it will take more effort and the solution might not be portable...

DarumAa at 2007-7-12 > top of java,Security,Cryptography...
# 4
Do u know whether the license of the bouncycastle packages are GNU complaint. Anyone having information regarding this please reply
av85a at 2007-7-12 > top of java,Security,Cryptography...
# 5
Couldn't you just read the license yourself?
ghstarka at 2007-7-12 > top of java,Security,Cryptography...