Current File : //usr/lib/python2.7/site-packages/paramiko/pkey.pyo |
�
=OXc @ s� d Z d d l Z d d l m Z d d l Z d d l m Z d d l m Z d d l m
Z
d d l m Z m
Z
m Z d d l m Z d d l m Z d d
l m Z m Z m Z m Z d d l m Z m Z d e f d
� � YZ d S( s!
Common API for all public keys.
i����N( t unhexlify( t md5( t default_backend( t
serialization( t
algorithmst modest Cipher( t util( t o600( t ut encodebytest decodebytest b( t SSHExceptiont PasswordRequiredExceptiont PKeyc B sD e Z d Z i i e j d 6d d 6d d 6e j d 6d 6i e j d 6d d 6d d 6e j d 6d 6Z d d d
� Z
d � Z d � Z d
� Z
d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d d � � Z e d d � � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z RS( s%
Base class for public keys.
t cipheri t keysizet blocksizet modes AES-128-CBCi i s DES-EDE3-CBCc C s d S( sI
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.
N( ( t selft msgt data( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt __init__; s c C s t � S( s�
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.
( t bytes( R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt asbytesL s c C s
| j � S( N( R ( R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt __str__T s c C sJ t | � } t | � } | | k r1 t | | � St | j � | j � � S( sB
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.
:param .Pkey other: key to compare to.
( t hasht cmpR ( R t othert hst ho( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt __cmp__X s
c C s t | � t | � k S( N( R ( R R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt __eq__g s c C s d S( s�
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"``).
t ( ( R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt get_namej s c C s d S( s�
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`)
i ( ( R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt get_bitst s c C s t S( sf
Return ``True`` if this key has the private part necessary for signing
data.
( t False( R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt can_sign} s c C s t | j � � j � S( s�
Return an MD5 fingerprint of the public part of this key. Nothing
secret is revealed.
:return:
a 16-byte `string <str>` (binary) of the MD5 fingerprint, in SSH
format.
( R R t digest( R ( ( s1 /usr/lib/python2.7/site-packages/paramiko/pkey.pyt get_fingerprint� s c C s"