Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files (x86)/MySQL/MySQL Workbench 6.1 CE/python/site-packages/paramiko/ |
Upload File : |
ó ¤'Sc @ s´ d Z d d l Z d d l m Z m Z d d l Z d d l m Z d d l m Z m Z d d l Td d l m Z d d l 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 hexlifyt unhexlify( t MD5( t DES3t AES( t *( t util( t Message( t SSHExceptiont PasswordRequiredExceptiont PKeyc B s8 e Z d Z i i e d 6d d 6d d 6e j d 6d 6i e 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 d „ Z e e ƒ Z d d „ Z e e ƒ 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( sY Create a new instance of this public key type. If C{msg} is given, the key's public part(s) will be filled in from the message. If C{data} is given, the key's public part(s) will be filled in from the string. @param msg: an optional SSH L{Message} containing a public key of this type. @type msg: L{Message} @param data: an optional string containing a public key of this type @type data: str @raise SSHException: if a key cannot be created from the C{data} or C{msg} given, or no key was passed in. N( ( t selft msgt data( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt __init__0 s c C s d S( s Return a string of an SSH L{Message} made up of the public part(s) of this key. This string is suitable for passing to L{__init__} to re-create the key object later. @return: string representation of an SSH key message. @rtype: str t ( ( R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt __str__B s c C sJ t | ƒ } t | ƒ } | | k r1 t | | ƒ St t | ƒ t | ƒ ƒ S( s± 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 other: key to compare to. @type other: L{PKey} @return: 0 if the two keys are equivalent, non-0 otherwise. @rtype: int ( t hasht cmpt str( R t othert hst ho( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt __cmp__M 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 (for example, C{"ssh-rsa"}). @rtype: str R ( ( R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt get_name_ 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. @rtype: int i ( ( R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt get_bitsi s c C s t S( s® Return C{True} if this key has the private part necessary for signing data. @return: C{True} if this is a private key. @rtype: bool ( t False( R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt can_signs s c C s t j t | ƒ ƒ j ƒ S( sã Return an MD5 fingerprint of the public part of this key. Nothing secret is revealed. @return: a 16-byte string (binary) of the MD5 fingerprint, in SSH format. @rtype: str ( R t newR t digest( R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt get_fingerprint} s c C s t j t | ƒ ƒ j d d ƒ S( s7 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. @return: a base64 string containing the public part of the key. @rtype: str s R ( t base64t encodestringR t replace( R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt get_base64ˆ s c C s d S( sp Sign a blob of data with this private key, and return a L{Message} representing an SSH signature message. @param rng: a secure random number generator. @type rng: L{Crypto.Util.rng.RandomPool} @param data: the data to sign. @type data: str @return: an SSH signature message. @rtype: L{Message} R ( ( R t rngR ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt sign_ssh_data“ s c C s t S( s› Given a blob of data, and an SSH message representing a signature of that data, verify that it was signed with this key. @param data: the data that was signed. @type data: str @param msg: an SSH signature message @type msg: L{Message} @return: C{True} if the signature verifies correctly; C{False} otherwise. @rtype: boolean ( R ( R R R ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt verify_ssh_sig¡ s c C s | d | d | ƒ } | S( s× Create a key object by reading a private key file. If the private key is encrypted and C{password} is not C{None}, the given password will be used to decrypt the key (otherwise L{PasswordRequiredException} is thrown). Through the magic of python, this factory method will exist in all subclasses of PKey (such as L{RSAKey} or L{DSSKey}), but is useless on the abstract PKey class. @param filename: name of the file to read @type filename: str @param password: an optional password to use to decrypt the key file, if it's encrypted @type password: str @return: a new key object based on the given private key @rtype: L{PKey} @raise IOError: if there was an error reading the file @raise PasswordRequiredException: if the private key file is encrypted, and C{password} is C{None} @raise SSHException: if the key file is invalid t filenamet password( ( t clsR* R+ t key( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt from_private_key_file° s c C s | d | d | ƒ } | S( s8 Create a key object by reading a private key from a file (or file-like) object. If the private key is encrypted and C{password} is not C{None}, the given password will be used to decrypt the key (otherwise L{PasswordRequiredException} is thrown). @param file_obj: the file to read from @type file_obj: file @param password: an optional password to use to decrypt the key, if it's encrypted @type password: str @return: a new key object based on the given private key @rtype: L{PKey} @raise IOError: if there was an error reading the key @raise PasswordRequiredException: if the private key file is encrypted, and C{password} is C{None} @raise SSHException: if the key file is invalid t file_objR+ ( ( R, R/ R+ R- ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt from_private_keyÊ s c C s t d ƒ ‚ d S( s³ Write private key contents into a file. If the password is not C{None}, the key is encrypted before writing. @param filename: name of the file to write @type filename: str @param password: an optional password to use to encrypt the key file @type password: str @raise IOError: if there was an error writing the file @raise SSHException: if the key is invalid s Not implemented in PKeyN( t Exception( R R* R+ ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt write_private_key_fileâ s c C s t d ƒ ‚ d S( sÌ Write private key contents into a file (or file-like) object. If the password is not C{None}, the key is encrypted before writing. @param file_obj: the file object to write into @type file_obj: file @param password: an optional password to use to encrypt the key @type password: str @raise IOError: if there was an error writing to the file @raise SSHException: if the key is invalid s Not implemented in PKeyN( R1 ( R R/ R+ ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt write_private_keyñ s c C s2 t | d ƒ } | j | | | ƒ } | j ƒ | S( s Read an SSH2-format private key file, looking for a string of the type C{"BEGIN xxx PRIVATE KEY"} for some C{xxx}, base64-decode the text we find, and return it as a string. If the private key is encrypted and C{password} is not C{None}, the given password will be used to decrypt the key (otherwise L{PasswordRequiredException} is thrown). @param tag: C{"RSA"} or C{"DSA"}, the tag used to mark the data block. @type tag: str @param filename: name of the file to read. @type filename: str @param password: an optional password to use to decrypt the key file, if it's encrypted. @type password: str @return: data blob that makes up the private key. @rtype: str @raise IOError: if there was an error reading the file. @raise PasswordRequiredException: if the private key file is encrypted, and C{password} is C{None}. @raise SSHException: if the key file is invalid. t r( t opent _read_private_keyt close( R t tagR* R+ t fR ( ( sY C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE/python/site-packages\paramiko\pkey.pyt _read_private_key_file s c C s¬ | j ƒ } d } x>