Exemple #1
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));
        }
 public string ExtractPublicKey(string keyPair)
 {
     return(RsaKeyTools.ExtractPublicKey(keyPair));
 }