diff options
-rw-r--r-- | cryptography/hazmat/backends/openssl/rsa.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cryptography/hazmat/backends/openssl/rsa.py b/cryptography/hazmat/backends/openssl/rsa.py index 2fada1b9..a62a89f4 100644 --- a/cryptography/hazmat/backends/openssl/rsa.py +++ b/cryptography/hazmat/backends/openssl/rsa.py @@ -422,7 +422,11 @@ class _RSAPrivateKey(object): assert res == 1 self._evp_pkey = evp_pkey - self.key_size = self._backend._lib.BN_num_bits(self._rsa_cdata.n) + self._key_size = self._backend._lib.BN_num_bits(self._rsa_cdata.n) + + @property + def key_size(self): + return self._key_size def signer(self, padding, algorithm): return _RSASignatureContext(self._backend, self, padding, algorithm) @@ -474,7 +478,11 @@ class _RSAPublicKey(object): assert res == 1 self._evp_pkey = evp_pkey - self.key_size = self._backend._lib.BN_num_bits(self._rsa_cdata.n) + self._key_size = self._backend._lib.BN_num_bits(self._rsa_cdata.n) + + @property + def key_size(self): + return self._key_size def verifier(self, signature, padding, algorithm): return _RSAVerificationContext( |