Encoding a passport into a byte array for transport to the server