Example #1
0
        private string DecodeQrCode(WriteableBitmap wb)
        {
            IBarcodeReader reader = QrTools.GetQrReader();
            var            result = reader.Decode(wb);

            return(result?.Text);
        }
Example #2
0
        public async Task GenerateQrCode(string contactName)
        {
            IUserModel             user       = _storageService.GetUser();
            string                 publicKey  = RsaKeyTools.ExtractPublicKey(user.KeyPair);
            Tuple <string, string> pkElements = RsaKeyTools.DecomposePublicKey(publicKey);

            string contents = ComposeQrData(user.Id, contactName, pkElements.Item1, pkElements.Item2);

            IBarcodeWriter writer = QrTools.GetQrWriter();

            var matrix = writer.Encode(contents);
            var wb     = writer.Write(matrix);

            await PictureLibraryTools.SaveWriteableBitmap(wb, string.Format(QrCodeFileName, contactName));
        }