From 6177cbe2fad1422899a2c26cb53abbbf97886485 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Fri, 27 Feb 2015 17:05:52 -0600 Subject: address review feedback --- src/cryptography/hazmat/backends/openssl/rsa.py | 10 +++++----- src/cryptography/hazmat/primitives/asymmetric/rsa.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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. """ -- cgit v1.2.3