CryptCert.export_cert(CryptCert.FORMAT.TEXT_CERTIFICATE) should now work properly instead of always returning an error.