Saving public key into db