added a function to return the public key string from a keypair object