Adding authentication and Mediator keys

This is a work in progress and should not be merged with the master yet.