Hello.
I'm trying to create my certificates (as a CA). I retrieve correctly the timestamps from the log servers. The final step is adding that timestamp into a X509v3 certificate. Let's say I have retrieved two timestamps with a JSON structure similar with this:
[{"sct_version":0,"id":"blahblahblahblahblah=","timestamp":100000000000,"extensions":"","signature":"blahblah"},{"sct_version":0,"id":"dumdadidooodamdamdidudidaa","timestamp":100000000001,"extensions":"","signature":"blahblahdata=="}]
So then, I add it on the config file in openssl in order to generate a cert with that data in the OID "1.3.6.1.4.1.11129.2.4.2". The trouble is that i don't know in what format should I add it. Here's some examples I tried:
..............................................................................................................
google_sct=DER:A_LONG_CHAIN_IN_HEX_FORMAT
..............................................................................................................
..............................................................................................................
google_sct=ASN1:OCT:A_LONG_CHAIN_IN_HEX_FORMAT
..............................................................................................................
..............................................................................................................
google_sct=ASN1:OCT:s:463:"HERE_LIES_THE_JSON_RESPONSE_FROM_LOG_SERVERS"
..............................................................................................................
No matter what I try, the generated PEM file doesn't have the data encoded in a similar way that I have on a legal certificate with the SCT added as an extension that we use to compare the results.
I've faked the data but, the format I see on the OID for SCTs on the correctly generated certificate is similar to this:
......X.
k....G..
:...).1.
Fs4J..D.
.s..SO..
...1S..B
.....TYE
Even I don't know what kind of format is this (I supose is a asn1 binary octet in an unknown (for me) representation). And on my examples, it seems it just add the data as the hex itself or it just adds the plain JSON structure.
The Certificate Transparency RFC tells us the way that info should be added:
Similarly, a certificate authority MAY submit a Precertificate to
more than one log, and all obtained SCTs can be directly embedded in
the final certificate, by encoding the SignedCertificateTimestampList
structure as an ASN.1 OCTET STRING and inserting the resulting data
in the TBSCertificate as an X.509v3 certificate extension (OID
1.3.6.1.4.1.11129.2.4.2).
So... anyone knows what is the correct format to place in the config file to generate the data as desired in the correctly generated certificate that I'm using as example? Hope I have explained my trouble correctly, and I'm really sorry about my bad english.
Many thanks!