-
Notifications
You must be signed in to change notification settings - Fork 43
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 certificate property to check if the certificate is valid or not #31
Comments
Hi! Thanks for your suggestion. I'm not quite sure what area you are talking about. The Model class in the code? The command-line interface? The web interface? |
The Model class.
from datetime import datetime
def expired(self):
return self.certificate.x509.not_valid_before > datetime.now()
def valid(self):
return self.revoked() or self.expired() You can also add it on the Admin list view as a boolean property. |
The latter would mean the certificate is "valid" if it is either revoked or expired. Is that really what you want? |
Yes. |
However, the opposite is true. A certificate is valid if it is neither revoked nor expired. Thus closing. |
Hi,
There is no easy way to check if a certificate is valid or not based on expiration date or revoked.
I suggest to add two properties:
"expired": like "revoked" but checking if the cert is expired or not
"valid": return true if not revoked or expired or false if expired or revoked.
The text was updated successfully, but these errors were encountered: