diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-08 00:00:55 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-08 00:00:55 -0700 |
| commit | 02f5caa833bf01e537f0bff94c3a71a675d234c4 (patch) | |
| tree | f48b5ed4ce61b272bae4d7cba0884702c67387e7 /cryptography | |
| parent | 7f68ccda2080c427f5e34b4ecc16cba9a030f2c6 (diff) | |
| parent | 5a3e0754f94a280783e0d5b9c1082097566fa62f (diff) | |
| download | cryptography-02f5caa833bf01e537f0bff94c3a71a675d234c4.tar.gz cryptography-02f5caa833bf01e537f0bff94c3a71a675d234c4.tar.bz2 cryptography-02f5caa833bf01e537f0bff94c3a71a675d234c4.zip | |
Merge branch 'master' into deprecation
Diffstat (limited to 'cryptography')
| -rw-r--r-- | cryptography/__about__.py | 2 | ||||
| -rw-r--r-- | cryptography/exceptions.py | 1 | ||||
| -rw-r--r-- | cryptography/hazmat/backends/multibackend.py | 12 |
3 files changed, 13 insertions, 2 deletions
diff --git a/cryptography/__about__.py b/cryptography/__about__.py index f18f5099..eb022fbd 100644 --- a/cryptography/__about__.py +++ b/cryptography/__about__.py @@ -22,7 +22,7 @@ __summary__ = ("cryptography is a package which provides cryptographic recipes" " and primitives to Python developers.") __uri__ = "https://github.com/pyca/cryptography" -__version__ = "0.5" +__version__ = "0.6.dev1" __author__ = "The cryptography developers" __email__ = "cryptography-dev@python.org" diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py index c64b67f4..c14763f7 100644 --- a/cryptography/exceptions.py +++ b/cryptography/exceptions.py @@ -22,6 +22,7 @@ class _Reasons(object): UNSUPPORTED_MGF = object() UNSUPPORTED_PUBLIC_KEY_ALGORITHM = object() UNSUPPORTED_ELLIPTIC_CURVE = object() + UNSUPPORTED_SERIALIZATION = object() class UnsupportedAlgorithm(Exception): diff --git a/cryptography/hazmat/backends/multibackend.py b/cryptography/hazmat/backends/multibackend.py index 800c3503..6741f045 100644 --- a/cryptography/hazmat/backends/multibackend.py +++ b/cryptography/hazmat/backends/multibackend.py @@ -17,7 +17,7 @@ from cryptography import utils from cryptography.exceptions import UnsupportedAlgorithm, _Reasons from cryptography.hazmat.backends.interfaces import ( CMACBackend, CipherBackend, DSABackend, EllipticCurveBackend, HMACBackend, - HashBackend, PBKDF2HMACBackend, RSABackend + HashBackend, PBKDF2HMACBackend, PKCS8SerializationBackend, RSABackend ) @@ -26,6 +26,7 @@ from cryptography.hazmat.backends.interfaces import ( @utils.register_interface(HashBackend) @utils.register_interface(HMACBackend) @utils.register_interface(PBKDF2HMACBackend) +@utils.register_interface(PKCS8SerializationBackend) @utils.register_interface(RSABackend) @utils.register_interface(DSABackend) @utils.register_interface(EllipticCurveBackend) @@ -302,3 +303,12 @@ class MultiBackend(object): "This backend does not support this elliptic curve.", _Reasons.UNSUPPORTED_ELLIPTIC_CURVE ) + + def load_pkcs8_pem_private_key(self, data, password): + for b in self._filtered_backends(PKCS8SerializationBackend): + return b.load_pkcs8_pem_private_key(data, password) + + raise UnsupportedAlgorithm( + "This backend does not support this key serialization.", + _Reasons.UNSUPPORTED_SERIALIZATION + ) |
