Add some exceptions. Better constructor for public and private keys