Sign pubkeys

Implements public key signing, using the user ID associated with the signToken and the domain of the server to derive the principle.

This will need to be rebased once we merge in the kvstore changes.