diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-25 11:13:45 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-25 11:16:24 -0600 |
commit | aa8b0f43db0f4708ecf12ba2a2034ba6165d5f76 (patch) | |
tree | 95195d5a52f3ed575a2f7ac42f50187a08eae05a /src | |
parent | 58dc259214ff05243ec4e72c86cc2c7a76ca6e02 (diff) | |
download | cryptography-aa8b0f43db0f4708ecf12ba2a2034ba6165d5f76.tar.gz cryptography-aa8b0f43db0f4708ecf12ba2a2034ba6165d5f76.tar.bz2 cryptography-aa8b0f43db0f4708ecf12ba2a2034ba6165d5f76.zip |
add create_x509_revoked_certificate to x509backend interface
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/backends/interfaces.py | 7 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/multibackend.py | 9 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/interfaces.py b/src/cryptography/hazmat/backends/interfaces.py index a1d6f812..5b9e6f38 100644 --- a/src/cryptography/hazmat/backends/interfaces.py +++ b/src/cryptography/hazmat/backends/interfaces.py @@ -299,6 +299,13 @@ class X509Backend(object): CertificateRevocationListBuilder object. """ + @abc.abstractmethod + def create_x509_revoked_certificate(self, builder): + """ + Create a RevokedCertificate object from a RevokedCertificateBuilder + object. + """ + @six.add_metaclass(abc.ABCMeta) class DHBackend(object): diff --git a/src/cryptography/hazmat/backends/multibackend.py b/src/cryptography/hazmat/backends/multibackend.py index ebecb364..65f18531 100644 --- a/src/cryptography/hazmat/backends/multibackend.py +++ b/src/cryptography/hazmat/backends/multibackend.py @@ -393,3 +393,12 @@ class MultiBackend(object): "This backend does not support X.509.", _Reasons.UNSUPPORTED_X509 ) + + def create_x509_revoked_certificate(self, builder): + for b in self._filtered_backends(X509Backend): + return b.create_x509_revoked_certificate(builder) + + raise UnsupportedAlgorithm( + "This backend does not support X.509.", + _Reasons.UNSUPPORTED_X509 + ) diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 65792c3b..a60bf82b 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -1558,6 +1558,9 @@ class Backend(object): res = add_func(x509_obj, x509_extension, i) self.openssl_assert(res >= 1) + def create_x509_revoked_certificate(self, builder): + raise NotImplementedError("Not yet implemented") + def load_pem_private_key(self, data, password): return self._load_key( self._lib.PEM_read_bio_PrivateKey, |