x509_decode_time(9)
π x509_decode_time π
Okay bestie, welcome to the x509_decode_time(9) page β it lives in the Kernel API Manual, and it's literally the little function that turns a squiggly X.509 time blob into something the kernel can actually read. Grab a strawberry drink π and let's go.
β¨ NAME β¨
x509_decode_time β decode an X.509 time ASN.1 object. That's it, that's the whole job. Iconic, honestly.
π SYNOPSIS π
int x509_decode_time (time64_t *_t , size_t hdrlen , unsigned char tag ,
const unsigned char *value , size_t vlen );
πΈ ARGUMENTS πΈ
_tβ the time you're filling in. It's the whole point of the function, so likeβ¦ be nice to it πhdrlenβ the length of the object headertagβ the object tagvalueβ the object valuevlenβ the size of the object value
π¦ DESCRIPTION π¦
So what does it do? It decodes an ASN.1 universal time or generalised time field into a struct the kernel can handle, and then β this is the important part β it checks it for validity. No cap, the validation is not a vibe, it's a requirement. π
The time is decoded thus:
[RFC5280 Β§4.1.2.5] CAs conforming to this profile MUST always encode certificate validity dates through the year 2049 as UTCTime; certificate validity dates in 2050 or later MUST be encoded as GeneralizedTime. Conforming applications MUST be able to process validity dates that are encoded in either UTCTime or GeneralizedTime.
Read that twice, bestie, because the split is year 2049 vs 2050 and beyond β UTCTime before, GeneralizedTime after, and you gotta handle both on the way in. Periodt. π
π₯ SEE ALSO π₯
- Kernel file
./crypto/asymmetric_keys/x509_cert_parser.cβ go read it, iykyk β¨
That's the whole page, bestie! This masterpiece comes from ./crypto/asymmetric_keys, dated October 2026, and it's version x509_decode_time(9) energy all the way down. Mwah π
π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms