diff options
author | Sebastian Bachmann <bachmann.s@ikarus.at> | 2018-05-02 16:31:58 +0200 |
---|---|---|
committer | Jörn Heissler <github@joern.heissler.de> | 2018-06-30 23:32:12 +0200 |
commit | 4c0d7e904f607edafe1ff7608bef77a8b20b5489 (patch) | |
tree | d10119c4535415989a50a6c143de7a7062e90839 /asn1crypto/x509.py | |
parent | 21fc3ced57392ffafca6e5f49be0b404a1a0a977 (diff) | |
download | asn1crypto-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.py | 16 |
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: |