Beispiel #1
0
        private static async void DecryptFile(TLSecureFile secureFile, TLInputFileLocationBase inputFileLocation, string localFileName, string previewFileName)
        {
            var fileSecret = Passport.DecryptValueSecret(
                secureFile.Secret,
                EnterPasswordViewModel.Secret,
                secureFile.FileHash);

            var encryptedFile = await ApplicationData.Current.LocalFolder.GetFileAsync(inputFileLocation.GetFileName("document"));

            var decryptedTuple = await Passport.DecryptFile(localFileName, encryptedFile, fileSecret, secureFile.FileHash);

            var stream = await decryptedTuple.Item1.OpenReadAsync();

            await DialogDetailsViewModel.ResizeJpeg(stream, 180, localFileName, previewFileName);

            Telegram.Api.Helpers.Execute.BeginOnUIThread(() =>
            {
                secureFile.NotifyOfPropertyChange(() => secureFile.Self);
            });
        }