diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/exceptions.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/x509.py | 5 | ||||
-rw-r--r-- | src/cryptography/x509.py | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/cryptography/exceptions.py b/src/cryptography/exceptions.py index 23edcd02..b0e1a993 100644 --- a/src/cryptography/exceptions.py +++ b/src/cryptography/exceptions.py @@ -53,7 +53,3 @@ class InvalidKey(Exception): class InvalidToken(Exception): pass - - -class InvalidX509Version(Exception): - pass diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py index 9f6f71d0..6befc3cf 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -16,7 +16,6 @@ from __future__ import absolute_import, division, print_function import datetime from cryptography import utils, x509 -from cryptography.exceptions import InvalidX509Version from cryptography.hazmat.primitives import hashes, interfaces @@ -61,8 +60,8 @@ class _X509Certificate(object): elif version == 2: return x509.X509Version.v3 else: - raise InvalidX509Version( - "{0} is not a valid X509 version", version + raise x509.InvalidX509Version( + "{0} is not a valid X509 version".format(version) ) @property diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index f3c73d6b..191666e6 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -18,3 +18,7 @@ def load_pem_x509_certificate(data, backend): def load_der_x509_certificate(data, backend): return backend.load_der_x509_certificate(data) + + +class InvalidX509Version(Exception): + pass |