def get_identity_credentials(aip):
    """Returns a dictionary containing a mapping from publickey to identity"""

    agent_map = aip.get_agent_identity_to_uuid_mapping()
    agent_credential_map = {}
    for agent in agent_map:
        agent_credential = aip.get_agent_keystore(agent_map[agent]).public
        agent_credential_map[agent_credential] = agent
    return agent_credential_map