def file_decrypt_from_key_info( sender_key_info, blockchain_id, key_index, hostname, input_path, output_path, passphrase=None, config_path=CONFIG_PATH, wallet_keys=None ):
config_dir = os.path.dirname(config_path)<EOL>my_key_info = file_key_lookup( blockchain_id, key_index, hostname, config_path=config_path, wallet_keys=wallet_keys )<EOL>if '<STR_LIT:error>' in my_key_info:<EOL><INDENT>log.error("<STR_LIT>" % my_key_info['<STR_LIT:error>'])<EOL>return {'<STR_LIT:status>': True, '<STR_LIT:error>': '<STR_LIT>'}<EOL><DEDENT>res = None <EOL>with open(input_path, "<STR_LIT:r>") as f:<EOL><INDENT>res = blockstack_gpg.gpg_decrypt( f, output_path, sender_key_info, my_key_info, passphrase=passphrase, config_dir=config_dir )<EOL><DEDENT>if '<STR_LIT:error>' in res:<EOL><INDENT>if res['<STR_LIT:error>'] == '<STR_LIT>':<EOL><INDENT>log.warn("<STR_LIT>" % my_key_info['<STR_LIT>'])<EOL>return {'<STR_LIT:status>': True, '<STR_LIT:error>': '<STR_LIT>'}<EOL><DEDENT>else:<EOL><INDENT>log.error("<STR_LIT>" % res['<STR_LIT:error>'])<EOL>return {'<STR_LIT:status>': False, '<STR_LIT:error>': '<STR_LIT>' % res['<STR_LIT:error>']}<EOL><DEDENT><DEDENT>return {'<STR_LIT:status>': True}<EOL>
Try to decrypt data with one of the receiver's keys
Return {'status': True} if we succeeded
Return {'error': ..., 'status': False} if we failed permanently
Return {'error': ..., 'status': True} if the key failed, and we should try the next one.