def _read_ssh_ed25519_pubkey(keydata):
 if (type(keydata) != six.text_type):
  raise Exception('invalid type {} for keydata'.format(type(keydata)))
 parts = keydata.strip().split()
 if (len(parts) != 3):
  raise Exception('invalid SSH Ed25519 public key')
 (algo, keydata, comment) = parts
 if (algo != u'ssh-ed25519'):
  raise Exception('not a Ed25519 SSH public key (but {})'.format(algo))
 blob = binascii.a2b_base64(keydata)
 try:
  key = _unpack(blob)[1]
 except Exception as e:
  raise Exception('could not parse key ({})'.format(e))
 if (len(key) != 32):
  raise Exception('invalid length {} for embedded raw key (must be 32 bytes)'.format(len(key)))
 return (key, comment)

def _read_ssh_ed25519_pubkey ( keydata ) : if ( type ( keydata ) != six . text_type ) : raise Exception ( 'invalid type {} for keydata' . format ( type ( keydata ) ) ) parts = keydata . strip ( ) . split ( ) if ( len ( parts ) != 3 ) : raise Exception ( 'invalid SSH Ed25519 public key' ) ( algo , keydata , comment ) = parts if ( algo != u'ssh-ed25519' ) : raise Exception ( 'not a Ed25519 SSH public key (but {})' . format ( algo ) ) blob = binascii . a2b_base64 ( keydata ) try : key = _unpack ( blob ) [ 1 ] except Exception as e : raise Exception ( 'could not parse key ({})' . format ( e ) ) if ( len ( key ) != 32 ) : raise Exception ( 'invalid length {} for embedded raw key (must be 32 bytes)' . format ( len ( key ) ) ) return ( key , comment )
parse an openssh ed25519 public key from a string into a raw public key .