diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-27 17:05:52 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-27 17:05:52 -0600 |
commit | 6177cbe2fad1422899a2c26cb53abbbf97886485 (patch) | |
tree | f748a67d27b9bded4e678f9d5dc4773607c086e0 /src | |
parent | 858dd3fcb2851b647c2581c8f4246d0d9c7c2be2 (diff) | |
download | cryptography-6177cbe2fad1422899a2c26cb53abbbf97886485.tar.gz cryptography-6177cbe2fad1422899a2c26cb53abbbf97886485.tar.bz2 cryptography-6177cbe2fad1422899a2c26cb53abbbf97886485.zip |
address review feedback
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/rsa.py | 10 | ||||
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/rsa.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/rsa.py b/src/cryptography/hazmat/backends/openssl/rsa.py index 0a1f106f..ce6f646c 100644 --- a/src/cryptography/hazmat/backends/openssl/rsa.py +++ b/src/cryptography/hazmat/backends/openssl/rsa.py @@ -565,21 +565,21 @@ class _RSAPrivateKey(object): ) ) - def as_bytes(self, encoding, fmt, encryption_algorithm): + def as_bytes(self, encoding, format, encryption_algorithm): if not isinstance(encoding, Encoding): raise TypeError("encoding must be an item from the Encoding enum") - if not isinstance(fmt, Format): + if not isinstance(format, Format): raise TypeError("format must be an item from the Format enum") # This is a temporary check until we land DER serialization. - if encoding != Encoding.PEM: + if encoding is not Encoding.PEM: raise ValueError("Only PEM encoding is supported by this backend") - if fmt == Format.PKCS8: + if format is Format.PKCS8: write_bio = self._backend._lib.PEM_write_bio_PKCS8PrivateKey key = self._evp_pkey - elif fmt == Format.TraditionalOpenSSL: + elif format is Format.TraditionalOpenSSL: write_bio = self._backend._lib.PEM_write_bio_RSAPrivateKey key = self._rsa_cdata diff --git a/src/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py index 160ac6aa..932868e1 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py +++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py @@ -50,7 +50,7 @@ class RSAPrivateKeyWithSerialization(RSAPrivateKey): """ @abc.abstractmethod - def as_bytes(self, encoding, fmt, encryption_algorithm): + def as_bytes(self, encoding, format, encryption_algorithm): """ Returns the key serialized as bytes. """ |