def raw_file(client, src, dest, opt):
    """Write the contents of a vault path/key to a file. Is
    smart enough to attempt and handle binary files that are
    base64 encoded."""
    path, key = path_pieces(src)
    resp = client.read(path)
    if not resp:
        client.revoke_self_token()
        raise aomi.exceptions.VaultData("Unable to retrieve %s" % path)
    else:
        if 'data' in resp and key in resp['data']:
            secret = resp['data'][key]
            if is_base64(secret):
                LOG.debug('decoding base64 entry')
                secret = portable_b64decode(secret)

            if is_aws(resp['data']) and 'sts' not in path:
                renew_secret(client, resp, opt)

            write_raw_file(secret, dest)
        else:
            client.revoke_self_token()
            e_msg = "Key %s not found in %s" % (key, path)
            raise aomi.exceptions.VaultData(e_msg)
Write the contents of a vault path/key to a file. Is
    smart enough to attempt and handle binary files that are
    base64 encoded.