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 - 04 Feb 2005 07:44 GMT
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/guide/security/CryptoSpec.html#CertificateFactory).
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
> I read from some document, sounds like the first several bytes shows
> the version, which starts from 0.
[quoted text clipped - 12 lines]
>
> Thanks