For Programmers: Free Programming Magazines  


Home > Archive > Java Security > February 2005 > What's the binary format of X509.v1 and v3?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author What's the binary format of X509.v1 and v3?
jacksu

2005-02-03, 4:01 pm

I read from some document, sounds like the first several bytes shows
the version, which starts from 0.

So for X509.v1, I should see the first byte "0", for v3, I should see
the first byte "2".

But when I decode the x509.v1 and v3's certificate, it appears the
format is not that way,

the first two bytes: 48, -126,

then for v1, the third byte is 2, and for v3, the third byte is 4.

Any idea on that?

Thanks

Karl Scheibelhofer

2005-02-04, 4:00 pm

such certificates are encoded as ASN.1 structures using DER encoding. read
http://luca.ntop.org/Teaching/Appunti/asn1.html for an introduction.
Java can parse such certificates out of the box (see
http://java.sun.com/j2se/1.5.0/docs...tificateFactory).

Karl

--

Karl Scheibelhofer, IAIK - Graz University of Technology
Inffeldgasse 16a, 8010 Graz, Austria
Fax: +43 316 873 5520
http://jce.iaik.tugraz.at/
Visit us at the RSA conference in San Francisco, 14-18 Feb 2005, booth 438


"jacksu" <jacksuyu@gmail.com> wrote in message
news:1107441793.933202.307760@g14g2000cwa.googlegroups.com...
> I read from some document, sounds like the first several bytes shows
> the version, which starts from 0.
>
> So for X509.v1, I should see the first byte "0", for v3, I should see
> the first byte "2".
>
> But when I decode the x509.v1 and v3's certificate, it appears the
> format is not that way,
>
> the first two bytes: 48, -126,
>
> then for v1, the third byte is 2, and for v3, the third byte is 4.
>
> Any idea on that?
>
> Thanks
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com