-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a valid
property to X509Certificate
#52931
Comments
validity
property to X509Certificate
valid
property to X509Certificate
Could we also add the format in which |
I wish they were returned as |
Seems like the linked PR will be merged soon. For future reference, you can find the format in test cases: node/test/parallel/test-crypto-x509.js Lines 97 to 98 in e4f61de
|
What is the problem this feature will solve?
I want to verify the validity of an X.509 certificate with a new property
x509.valid
.What is the feature you are proposing to solve the problem?
Information about a X.509 certificate can be retrieved via:
The properties
x509.validTo
andx509.validFrom
prints strings of the datetimes, but they are in a complex format, see https://github.com/openssl/openssl/blob/4a5088259e78127354f497931568de409ac905fc/crypto/asn1/a_time.c#L488-L549, and thus hard to parse intoDate
objects.The
openssl
CLI command has a way to see if a certificate is valid or not:I wish for a new property
valid
(boolean) to be added to anX509Certificate
.What alternatives have you considered?
Using
await execFile('openssl', ...)
but that is not ideal as I have to invoke a new process and also make sure thatopenssl
exists in the system which it might not do in e.g. containers.Ideally though there would be an output of
validTo
andvalidFrom
that had proper JavaScript Date objects. That would make it possible to warn about expiry etc. in an easier way before it even happens.The text was updated successfully, but these errors were encountered: