diff options
author | Scott Maxwell <scott@codecobblers.com> | 2014-03-07 20:45:26 -0800 |
---|---|---|
committer | Scott Maxwell <scott@codecobblers.com> | 2014-03-07 20:45:26 -0800 |
commit | f0017b83309899bf6fffc0fa90093c36f1a7f7ea (patch) | |
tree | 582d35dee4b32f022bddc2245731a76112f7ac8e /paramiko/rsakey.py | |
parent | 073c71a8223ff77cacd8c555ef63ce24f0c3d50c (diff) | |
download | paramiko-f0017b83309899bf6fffc0fa90093c36f1a7f7ea.tar.gz |
Fix import * and a bunch of PEP8 formatting
Diffstat (limited to 'paramiko/rsakey.py')
-rw-r--r-- | paramiko/rsakey.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py index 06f0085d..c93f3218 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -21,14 +21,14 @@ RSA keys. """ from Crypto.PublicKey import RSA -from Crypto.Hash import SHA, MD5 -from Crypto.Cipher import DES3 +from Crypto.Hash import SHA -from paramiko.common import * from paramiko import util +from paramiko.common import rng, max_byte, zero_byte, one_byte from paramiko.message import Message from paramiko.ber import BER, BERException from paramiko.pkey import PKey +from paramiko.py3compat import long from paramiko.ssh_exception import SSHException SHA1_DIGESTINFO = b'\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14' @@ -113,9 +113,9 @@ class RSAKey (PKey): def _encode_key(self): if (self.p is None) or (self.q is None): raise SSHException('Not enough key info to write private key file') - keylist = [ 0, self.n, self.e, self.d, self.p, self.q, - self.d % (self.p - 1), self.d % (self.q - 1), - util.mod_inverse(self.q, self.p) ] + keylist = [0, self.n, self.e, self.d, self.p, self.q, + self.d % (self.p - 1), self.d % (self.q - 1), + util.mod_inverse(self.q, self.p)] try: b = BER() b.encode(keylist) @@ -148,10 +148,8 @@ class RSAKey (PKey): return key generate = staticmethod(generate) - ### internals... - def _pkcs1imify(self, data): """ turn a 20-byte SHA1 hash into a blob of data as large as the key's N, |