aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509/__init__.py2
-rw-r--r--src/cryptography/x509/certificate_transparency.py46
2 files changed, 48 insertions, 0 deletions
diff --git a/src/cryptography/x509/__init__.py b/src/cryptography/x509/__init__.py
index 51914e1e..38ae0f07 100644
--- a/src/cryptography/x509/__init__.py
+++ b/src/cryptography/x509/__init__.py
@@ -4,6 +4,7 @@
from __future__ import absolute_import, division, print_function
+from cryptography.x509 import certificate_transparency
from cryptography.x509.base import (
Certificate, CertificateBuilder, CertificateRevocationList,
CertificateRevocationListBuilder,
@@ -110,6 +111,7 @@ OID_OCSP = AuthorityInformationAccessOID.OCSP
__all__ = [
+ "certificate_transparency",
"load_pem_x509_certificate",
"load_der_x509_certificate",
"load_pem_x509_csr",
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.
+ """