perl-crypt-openssl-x509
perl-crypt-openssl-x509 copied to clipboard
Not before / Not after as epoch
Hi! I'm enjoying this module and it would be great if it could return the x509 not before / not after as a UNIX timestamp instead of just as a formatted date.
I'm thinking about something like this:
print $x509->not_before_epoch() . "\n"; # 822870000
print $x509->not_after_epoch() . "\n"; # 1578437999
Since OpenSSL 1.1.1 there's an ASN1_TIME_to_tm function that simplifies this. I've already made a build that works by calling that function and exposing two additional accessors, but I'm wondering:
- is there a minimum OpenSSL version to target
- what I should do if the version is lower than 1.1.1
- whether you want this upstream and think it's a good idea.
I'd be glad to prepare a pull request if I could get some input on these things!