def load_key_file(path):
 try:
  key_file = path.open()
 except IOError as e:
  (code, failure) = e
  raise PathError('Private key file could not be opened.', e.filename, code, failure)
 keypair = ComparableKeyPair(keypair=KeyPair.load(key_file.read(), format=crypto.FILETYPE_PEM))
 return keypair

def load_key_file ( path ) : try : key_file = path . open ( ) except IOError as e : ( code , failure ) = e raise PathError ( 'Private key file could not be opened.' , e . filename , code , failure ) keypair = ComparableKeyPair ( keypair = KeyPair . load ( key_file . read ( ) , format = crypto . FILETYPE_PEM ) ) return keypair
load a private key from a specified path .