throw error if public key is not set, yet