To parse a cert, type:
openssl asn1parse -in <filename>
You'll see a list like this
SampleOpenSSLCertDump. Without going into details which I don't really understand anyway, this file format seems to divide the data into chunks grouped by type. By this it can use what I call 'logical offsets' into chunks of the data which are the same regardless of how much data is in each chunk. For instance, look at this excerpt:
...
311:d=4 hl=2 l= 0 prim: NULL
313:d=3 hl=3 l= 141 prim: BIT STRING
457:d=2 hl=4 l= 266 cons: cont [ 3 ]
...
This means at 'logical offset' 313 (which is
not the same as the physical byte offset within the file) we will find 141 bytes worth of
BIT STRING
To see this data; i.e. drill down into it, type:
openssl asn1parse -strparse 313 -in <filename>
If we do this we see the following:
0:d=0 hl=3 l= 137 cons: SEQUENCE
3:d=1 hl=3 l= 129 prim: INTEGER :ACCF4D02DBB5624D9453F2328CF51AA2
22154130D24501DC4447C294766475E7B2ECD283DF9CA90DDA7A8A825D3C12FA311944279CE98C6C
B5BFAAE14A9700375044A65D1554CFBB062F8965C8742DAD66DA71B36CAC0639600123BEB01DFB4A
654BB0EF46479CD506942C01038007DEA7828CC2BD44D31AE362C029E77F4169
135:d=1 hl=2 l= 3 prim: INTEGER :010001
...where the long chunk is the public key and the 3 byte thing after it is the public exponent.
--
TWikiGuest - 07 Dec 2001