Telegram Passport Data Decryption - FAQ
What is PassportDataDecryptionException
Methods on IDecrypter
might throw PassportDataDecryptionException
exception
if an error happens during decryption.
The exception message tells you what went wrong but there is not much you can do to resolve it.
Maybe let your user know the issue and ask for Passport data again.
It is important to pass each piece of encrypted data, e.g. Id Document, Passport File, etc., with the right accompanying credentials to decryption methods.
Spot the problem in this code decrypting driver's license files:
byte[] selfieContent = decrypter.DecryptFile(
encSelfieContent, // byte array of encrypted selfie file
credentials.SecureData.DriverLicense.FrontSide // WRONG! use selfie file credentials
);
// throws PassportDataDecryptionException: "Data hash mismatch at position 123."