certificate_transparency.py 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # This file is dual licensed under the terms of the Apache License, Version
  2. # 2.0, and the BSD License. See the LICENSE file in the root of this repository
  3. # for complete details.
  4. from __future__ import absolute_import, division, print_function
  5. import abc
  6. from enum import Enum
  7. import six
  8. class LogEntryType(Enum):
  9. X509_CERTIFICATE = 0
  10. PRE_CERTIFICATE = 1
  11. class Version(Enum):
  12. v1 = 0
  13. @six.add_metaclass(abc.ABCMeta)
  14. class SignedCertificateTimestamp(object):
  15. @abc.abstractproperty
  16. def version(self):
  17. """
  18. Returns the SCT version.
  19. """
  20. @abc.abstractproperty
  21. def log_id(self):
  22. """
  23. Returns an identifier indicating which log this SCT is for.
  24. """
  25. @abc.abstractproperty
  26. def timestamp(self):
  27. """
  28. Returns the timestamp for this SCT.
  29. """
  30. @abc.abstractproperty
  31. def entry_type(self):
  32. """
  33. Returns whether this is an SCT for a certificate or pre-certificate.
  34. """