Home | Trees | Index | Help |
---|
Package paramiko :: Class PKey |
|
object
--+
|
PKey
AgentKey
,
DSSKey
,
RSAKey
Method Summary | |
---|---|
Create a new instance of this public key type. | |
int |
Compare this key to another. |
str |
Return a string of an SSH Message made up of the public part(s) of
this key. |
str |
Read an SSH2-format private key file, looking for a string of the type "BEGIN xxx PRIVATE KEY" for some xxx ,
base64-decode the text we find, and return it as a string. |
Write an SSH2-format private key file in a form that can be read by paramiko or openssh. | |
bool |
Return True if this key has the private part necessary
for signing data. |
PKey
|
Create a key object by reading a private key file. (Class method) |
str |
Return a base64 string containing the public part of this key. |
int |
Return the number of significant bits in this key. |
str |
Return an MD5 fingerprint of the public part of this key. |
str |
Return the name of this private key implementation. |
Message
|
Sign a blob of data with this private key, and return a Message
representing an SSH signature message. |
boolean |
Given a blob of data, and an SSH message representing a signature of that data, verify that it was signed with this key. |
Write private key contents into a file. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value |
Class Variable Summary | |
---|---|
dict |
_CIPHER_TABLE = {'DES-EDE3-CBC': {'blocksize': 8, 'ciphe...
|
Instance Method Details |
---|
__init__(self,
msg=None,
data=None)
Create a new instance of this public key type. If |
__cmp__(self,
other)
Compare this key to another. Returns 0 if this key is equivalent to
the given key, or non-0 if they are different. Only the public parts of
the key are compared, so a public key will compare equal to its
corresponding private key.
|
__str__(self)
Return a string of an SSH |
_read_private_key_file(self, tag, filename, password=None)Read an SSH2-format private key file, looking for a string of the type"BEGIN xxx PRIVATE KEY" for some
xxx , base64-decode the text we find, and return it as a
string. 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).
|
_write_private_key_file(self, tag, filename, data, password=None)Write an SSH2-format private key file in a form that can be read by paramiko or openssh. If no password is given, the key is written in a trivially-encoded format (base64) which is completely insecure. If a password is given, DES-EDE3-CBC is used.
|
can_sign(self)ReturnTrue if this key has the private part necessary
for signing data.
|
get_base64(self)Return a base64 string containing the public part of this key. Nothing secret is revealed. This format is compatible with that used to store public key files or recognized host keys.
|
get_bits(self)Return the number of significant bits in this key. This is useful for judging the relative security of a key.
|
get_fingerprint(self)Return an MD5 fingerprint of the public part of this key. Nothing secret is revealed.
|
get_name(self)Return the name of this private key implementation.
|
sign_ssh_data(self, randpool, data)Sign a blob of data with this private key, and return aMessage representing an SSH signature
message.
|
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.
|
write_private_key_file(self, filename, password=None)Write private key contents into a file. If the password is notNone , the key is encrypted before writing.
|
Class Method Details |
---|
from_private_key_file(cl, filename, password=None)Create a key object by reading a private key file. If the private key is encrypted andpassword is not None ,
the given password will be used to decrypt the key (otherwise PasswordRequiredException is thrown).
Through the magic of python, this factory method will exist in all
subclasses of PKey (such as RSAKey or DSSKey ), but is useless on the abstract
PKey class.
|
Class Variable Details |
---|
_CIPHER_TABLE
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Dec 4 11:16:47 2005 | http://epydoc.sf.net |