diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-03-22 09:17:20 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-03-22 09:17:20 -0400 |
commit | bca951ebd869cb6c911cd6bba52b2d798366b409 (patch) | |
tree | 8bda40db80673aa37d7a541e2c32701fca8b1bb6 /src/cryptography/x509/certificate_transparency.py | |
parent | a783c57b7fa71a7cc6e354f37f79cc7239fb8bd7 (diff) | |
download | cryptography-bca951ebd869cb6c911cd6bba52b2d798366b409.tar.gz cryptography-bca951ebd869cb6c911cd6bba52b2d798366b409.tar.bz2 cryptography-bca951ebd869cb6c911cd6bba52b2d798366b409.zip |
Interfaces for SCTs, feedback wanted (#3467)
* Stub API for SCTs, feedback wanted
* grr, flake8
* port this to being an ABC
* finish up the __init__
* Two necessary enums
* Roll this back
* Wrote some docs
* spell words correctly
* linky
* more details
* use the words UTC
* coverage
* Define MMD for the kids at some
* linky linky
Diffstat (limited to 'src/cryptography/x509/certificate_transparency.py')
-rw-r--r-- | src/cryptography/x509/certificate_transparency.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cryptography/x509/certificate_transparency.py b/src/cryptography/x509/certificate_transparency.py new file mode 100644 index 00000000..d00fe812 --- /dev/null +++ b/src/cryptography/x509/certificate_transparency.py @@ -0,0 +1,46 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +from __future__ import absolute_import, division, print_function + +import abc +from enum import Enum + +import six + + +class LogEntryType(Enum): + X509_CERTIFICATE = 0 + PRE_CERTIFICATE = 1 + + +class Version(Enum): + v1 = 0 + + +@six.add_metaclass(abc.ABCMeta) +class SignedCertificateTimestamp(object): + @abc.abstractproperty + def version(self): + """ + Returns the SCT version. + """ + + @abc.abstractproperty + def log_id(self): + """ + Returns an identifier indicating which log this SCT is for. + """ + + @abc.abstractproperty + def timestamp(self): + """ + Returns the timestamp for this SCT. + """ + + @abc.abstractproperty + def entry_type(self): + """ + Returns whether this is an SCT for a certificate or pre-certificate. + """ |