New method to get encoded keypair