Rewrite KeyPair