aboutsummaryrefslogtreecommitdiff
path: root/asn1crypto/x509.py
diff options
context:
space:
mode:
authorSebastian Bachmann <bachmann.s@ikarus.at>2018-05-02 16:31:58 +0200
committerJörn Heissler <github@joern.heissler.de>2018-06-30 23:32:12 +0200
commit4c0d7e904f607edafe1ff7608bef77a8b20b5489 (patch)
treed10119c4535415989a50a6c143de7a7062e90839 /asn1crypto/x509.py
parent21fc3ced57392ffafca6e5f49be0b404a1a0a977 (diff)
downloadasn1crypto-4c0d7e904f607edafe1ff7608bef77a8b20b5489.tar.gz
Adding wrapper for valid_after and valid_before
This replicates the behaviour of the cryptography library
Diffstat (limited to 'asn1crypto/x509.py')
-rw-r--r--asn1crypto/x509.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/asn1crypto/x509.py b/asn1crypto/x509.py
index 3609c75..1dc9beb 100644
--- a/asn1crypto/x509.py
+++ b/asn1crypto/x509.py
@@ -2580,6 +2580,22 @@ class Certificate(Sequence):
return self._issuer_serial
@property
+ def not_valid_after(self):
+ """
+ :return:
+ A datetime of latest time when the certificate is still valid
+ """
+ return self['tbs_certificate']['validity']['not_after'].native
+
+ @property
+ def not_valid_before(self):
+ """
+ :return:
+ A datetime of the earliest time when the certificate is valid
+ """
+ return self['tbs_certificate']['validity']['not_before'].native
+
+ @property
def authority_key_identifier(self):
"""
:return: