Ñò
ÔãcJc @ sŽ d Z d d k Z d d k l Z l Z d d k Z d d k Td d k l Z d d k l
Z
d d d „ ƒ YZ d e i f d
„ ƒ YZ
d S( s
L{HostKeys}
iÿÿÿÿN( t SHAt HMAC( t *( t DSSKey( t RSAKeyt HostKeyEntryc B sD e Z d Z d d d „ Z d „ Z e e ƒ Z d „ Z d „ Z RS( sJ
Representation of a line in an OpenSSH-style "known hosts" file.
c C s2 | d j o
| d j | _ | | _ | | _ d S( N( t Nonet validt hostnamest key( t selfR R ( ( s5 /usr/lib/python2.6/site-packages/paramiko/hostkeys.pyt __init__% s c C s² | i d ƒ } t | ƒ d j o d S| d } | \ } } } | i d ƒ } | d j o t d t i | ƒ ƒ } n. | d j o t d t i | ƒ ƒ } n d S| | | ƒ S( sù
Parses the given line of text to find the names for the host,
the type of key, and the key data. The line is expected to be in the
format used by the openssh known_hosts file.
Lines are expected to not have leading or trailing whitespace.
We don't bother to check for comments or empty lines. All of
that should be taken care of before sending the line to us.
@param line: a line from an OpenSSH known_hosts file
@type line: str
t i t ,s ssh-rsat datas ssh-dssN( t splitt lenR R t base64t decodestringR ( t clst linet fieldst namest keytypeR ( ( s5 /usr/lib/python2.6/site-packages/paramiko/hostkeys.pyt from_line* s
c C s> | i o0 d d i | i ƒ | i i ƒ | i i ƒ f Sd S( s¦
Returns a string in OpenSSH known_hosts file format, or None if
the object is not in a valid state. A trailing newline is
included.
s %s %s %s
R
N( R t joinR R t get_namet
get_base64R ( R
( ( s5 /usr/lib/python2.6/site-packages/paramiko/hostkeys.pyt to_lineL s
c C s d | i | i f S( Ns