Home | Trees | Indices | Help |
---|
|
object --+ | pkey.PKey --+ | RSAKey
Representation of an RSA key which can be used to sign and verify SSH2 data.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
Class Methods | |
Inherited from |
Static Methods | |||
|
Properties | |
Inherited from |
Method Details |
Create a new instance of this public key type. If ``msg`` is given, the key's public part(s) will be filled in from the message. If ``data`` is given, the key's public part(s) will be filled in from the string. :param .Message msg: an optional SSH `.Message` containing a public key of this type. :param str data: an optional string containing a public key of this type :raises SSHException: if a key cannot be created from the ``data`` or ``msg`` given, or no key was passed in.
|
Return a string of an SSH `.Message` made up of the public part(s) of this key. This string is suitable for passing to `__init__` to re-create the key object later.
|
str(x)
|
hash(x)
|
Return the name of this private key implementation. :return: name of this private key type, in SSH terminology, as a `str` (for example, ``"ssh-rsa"``).
|
Return the number of significant bits in this key. This is useful for judging the relative security of a key. :return: bits in the key (as an `int`)
|
Return ``True`` if this key has the private part necessary for signing data.
|
Sign a blob of data with this private key, and return a `.Message` representing an SSH signature message. :param str data: the data to sign. :return: an SSH signature `message <.Message>`.
|
Given a blob of data, and an SSH message representing a signature of that data, verify that it was signed with this key. :param str data: the data that was signed. :param .Message msg: an SSH signature message :return: ``True`` if the signature verifies correctly; ``False`` otherwise.
|
Write private key contents into a file. If the password is not ``None``, the key is encrypted before writing. :param str filename: name of the file to write :param str password: an optional password to use to encrypt the key file :raises IOError: if there was an error writing the file :raises SSHException: if the key is invalid
|
Write private key contents into a file (or file-like) object. If the password is not ``None``, the key is encrypted before writing. :param file file_obj: the file object to write into :param str password: an optional password to use to encrypt the key :raises IOError: if there was an error writing to the file :raises SSHException: if the key is invalid
|
Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. :param int bits: number of bits the generated key should be. :param function progress_func: an optional function to call at key points in key generation (used by ``pyCrypto.PublicKey``). :return: new `.RSAKey` private key |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri May 30 12:33:11 2014 | http://epydoc.sourceforge.net |