Package paramiko :: Module rsakey :: Class RSAKey
[show private | hide private]
[frames | no frames]

Class RSAKey

object --+    
         |    
      PKey --+
             |
            RSAKey


Representation of an RSA key which can be used to sign and verify SSH2 data.
Method Summary
  __init__(self, msg, data)
Create a new instance of this public key type.
  __hash__(self)
string __str__(self)
Return a string of an SSH Message made up of the public part(s) of this key.
string get_name(self)
Return the name of this private key implementation.
  read_private_key_file(self, filename, password)
Read private key contents from a file into this object.
Message sign_ssh_data(self, randpool, data)
Sign a blob of data with this private key, and return a Message representing an SSH signature message.
boolean verify_ssh_sig(self, data, msg)
Given a blob of data, and an SSH message representing a signature of that data, verify that it was signed with this key.
    Inherited from PKey
int __cmp__(self, other)
Compare this key to another.
string get_fingerprint(self)
Return an MD5 fingerprint of the public part of this key.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Method Details

__init__(self, msg=None, data='')
(Constructor)

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.
Parameters:
msg - an optional SSH Message containing a public key of this type.
           (type=Message)
data - an optional string containing a public key of this type
           (type=string)
Overrides:
paramiko.pkey.PKey.__init__ (inherited documentation)

__str__(self)
(Informal representation operator)

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.
Returns:
string representation of an SSH key message.
           (type=string)
Overrides:
paramiko.pkey.PKey.__str__ (inherited documentation)

get_name(self)

Return the name of this private key implementation.
Returns:
name of this private key type, in SSH terminology (for example, "ssh-rsa").
           (type=string)
Overrides:
paramiko.pkey.PKey.get_name (inherited documentation)

read_private_key_file(self, filename, password=None)

Read private key contents from a file into this object. If the private key is encrypted and password is not None, the given password will be used to decrypt the key (otherwise PasswordRequiredException is thrown).
Parameters:
filename - name of the file to read.
           (type=string)
password - an optional password to use to decrypt the key file, if it's encrypted.
           (type=string)
Raises:
IOError - if there was an error reading the file.
PasswordRequiredException - if the private key file is encrypted, and password is None.
SSHException - if the key file is invalid
binascii.Error - on base64 decoding error
Overrides:
paramiko.pkey.PKey.read_private_key_file (inherited documentation)

sign_ssh_data(self, randpool, data)

Sign a blob of data with this private key, and return a Message representing an SSH signature message.
Parameters:
randpool - a secure random number generator.
           (type=Crypto.Util.randpool.RandomPool)
data - the data to sign.
           (type=string)
Returns:
an SSH signature message.
           (type=Message)
Overrides:
paramiko.pkey.PKey.sign_ssh_data (inherited documentation)

verify_ssh_sig(self, data, msg)

Given a blob of data, and an SSH message representing a signature of that data, verify that it was signed with this key.
Parameters:
data - the data that was signed.
           (type=string)
msg - an SSH signature message
           (type=Message)
Returns:
True if the signature verifies correctly; False otherwise.
           (type=boolean)
Overrides:
paramiko.pkey.PKey.verify_ssh_sig (inherited documentation)

Generated by Epydoc 2.0 on Sun Jan 4 02:33:11 2004 http://epydoc.sf.net