I need to read the extension field of a x.509 v3 certificate.
I use the java method getExtensionValue().
The method return an array of bytes DER-encoded.
I want to read it as a String and print it on screen. So I have to decode
the array and convert it.
I try a lot of way to do that but I never obtain good result.
Someone can help me?
Then, the DER encoding is equal to Base64 encoding or not?
Thanks
> The method return an array of bytes DER-encoded.
> Then, the DER encoding is equal to Base64 encoding or not?
No, DER encoding has nothing to do with Base64 or MIME encoding.
It is designed as part of the whole X.500 ISO data model.
It is word size and byte size and big and little-endian independant.
It is not trivial to decode, so search for a library.

Signature
Pat Farrell
http://www.pfarrell.com/prc/
Michel Gallant - 21 Mar 2005 21:00 GMT
A basic introduction to asn.1 (abstract syntax notation) and BER/DER
is in this book:
Planning for PKI, R. Housley, T. Polk, 2001 Wiley p. 69.
Here is an online book on the asn.1 standard:
http://www.oss.com/asn1/larmouth.html
and the popular 1993 RSA Labs publication:
"A Layman's Guide to a Subset of ASN1., BER, and DER"
ftp://ftp.rsasecurity.com/pub/pkcs/doc/layman.doc
Here is a binary view into a typical X.509 v3 cert:
http://www.jensign.com/JavaScience/GetTBSCert
- Mitch Gallant
> > The method return an array of bytes DER-encoded.
> > Then, the DER encoding is equal to Base64 encoding or not?
[quoted text clipped - 3 lines]
> It is word size and byte size and big and little-endian independant.
> It is not trivial to decode, so search for a library.
panax - 30 Mar 2005 17:25 GMT
There isn't free library for DER-decoding.
I need to decode octet string DER-encoded.
Have I to read and program ITU-T specifics? or is there some easier way?
Thanks
pAn
steffi - 31 Mar 2005 08:46 GMT
Have you looked at www.bouncycastle.org ?
Steffi
panax - 01 Apr 2005 12:20 GMT
Yes, I'm using bouncycastle packages, but I don't find the rigth method or
I do some mistakes.
I'm trying dumpAsString() method to decode DER objects but it doesn't work
correctly.
Some helps?
thanks again
pAn
steffi - 11 Apr 2005 13:11 GMT
Sorry, I just recently started using/evaluating bouncycastle and do not
really know how to use it. I'm still looking for some good
documentation (did I miss something on their website?).
I saw some packages dealing with DER so I thought they might be helpful
for you.
But, sorry again, I don't know (yet) how to use them.
Steffi