Storing public key in database