diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-11-24 08:41:05 -1000 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-11-24 08:41:05 -1000 |
commit | 05c122b5614740a50bee67808d4540ed94ae69e9 (patch) | |
tree | 2d80842375314348266fbfce907d9b262e6801f5 /src | |
parent | e987b81aefb7a6545ff23dee8468d0a234cd13f8 (diff) | |
download | cryptography-05c122b5614740a50bee67808d4540ed94ae69e9.tar.gz cryptography-05c122b5614740a50bee67808d4540ed94ae69e9.tar.bz2 cryptography-05c122b5614740a50bee67808d4540ed94ae69e9.zip |
Initial minimal X509Certificate interfaces
This will be expanded in the future to include algorithm identifier,
subject, issuer, extensions, etc
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/primitives/interfaces.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/interfaces.py b/src/cryptography/hazmat/primitives/interfaces.py index 7d9fc4fb..561be972 100644 --- a/src/cryptography/hazmat/primitives/interfaces.py +++ b/src/cryptography/hazmat/primitives/interfaces.py @@ -488,3 +488,36 @@ class MACContext(object): # DeprecatedIn07 CMACContext = MACContext + + +@six.add_metaclass(abc.ABCMeta) +class X509Certificate(object): + @abc.abstractmethod + def fingerprint(self, algorithm): + """ + Returns bytes using digest passed. + """ + + @abc.abstractproperty + def serial(self): + """ + Returns certificate serial number + """ + + @abc.abstractmethod + def public_key(self): + """ + Returns the public key + """ + + @abc.abstractproperty + def not_before(self): + """ + Not before time (represented as UTC datetime) + """ + + @abc.abstractproperty + def not_after(self): + """ + Not after time (represented as UTC datetime) + """ |