summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2014-02-26 18:55:14 -0800
committerJeff Forcier <jeff@bitprophet.org>2014-02-26 18:55:14 -0800
commitdfcd904318ed40af0e79efe72a293d538a3fb716 (patch)
tree94bedf5482a54ea5e072ca1e89ad02157e262a1d
parent5ee1fb478176c5db08e919f8cc3899a457a81eb0 (diff)
downloadparamiko-dfcd904318ed40af0e79efe72a293d538a3fb716.tar.gz
Last of the info field stuff
-rw-r--r--paramiko/util.py31
1 files changed, 13 insertions, 18 deletions
diff --git a/paramiko/util.py b/paramiko/util.py
index 0a75da70..e0ef3b7c 100644
--- a/paramiko/util.py
+++ b/paramiko/util.py
@@ -154,17 +154,13 @@ def generate_key_bytes(hashclass, salt, key, nbytes):
through a secure hash into some keyworthy bytes. This specific algorithm
is used for encrypting/decrypting private key files.
- :param hashclass: class from `Crypto.Hash` that can be used as a secure
- hashing function (like ``MD5`` or ``SHA``).
- :type hashclass: `Crypto.Hash`
- :param salt: data to salt the hash with.
- :type salt: string
- :param key: human-entered password or passphrase.
- :type key: string
- :param nbytes: number of bytes to generate.
- :type nbytes: int
- :return: key data
- :rtype: string
+ :param class hashclass:
+ class from `Crypto.Hash` that can be used as a secure hashing function
+ (like ``MD5`` or ``SHA``).
+ :param str salt: data to salt the hash with.
+ :param str key: human-entered password or passphrase.
+ :param int nbytes: number of bytes to generate.
+ :return: Key data `str`
"""
keydata = ''
digest = ''
@@ -185,19 +181,18 @@ def generate_key_bytes(hashclass, salt, key, nbytes):
def load_host_keys(filename):
"""
Read a file of known SSH host keys, in the format used by openssh, and
- return a compound dict of ``hostname -> keytype ->`` `PKey <paramiko.pkey.PKey>`.
- The hostname may be an IP address or DNS name. The keytype will be either
- ``"ssh-rsa"`` or ``"ssh-dss"``.
+ return a compound dict of ``hostname -> keytype ->`` `PKey
+ <paramiko.pkey.PKey>`. The hostname may be an IP address or DNS name. The
+ keytype will be either ``"ssh-rsa"`` or ``"ssh-dss"``.
This type of file unfortunately doesn't exist on Windows, but on posix,
it will usually be stored in ``os.path.expanduser("~/.ssh/known_hosts")``.
Since 1.5.3, this is just a wrapper around `.HostKeys`.
- :param filename: name of the file to read host keys from
- :type filename: str
- :return: dict of host keys, indexed by hostname and then keytype
- :rtype: dict(hostname, dict(keytype, `PKey <paramiko.pkey.PKey>`))
+ :param str filename: name of the file to read host keys from
+ :return:
+ nested dict of `.PKey` objects, indexed by hostname and then keytype
"""
from paramiko.hostkeys import HostKeys
return HostKeys(filename)