public void GenerateValidationCode(object sender, EventArgs e)
        {
            _currentChallenge = _certificateChallengeService.GenerateNewComplexUniqueChallenge();
            var _fullChallenge = CertificateChallengeService.GetFullChallenge(_currentChallenge);

            Device.BeginInvokeOnMainThread(() =>
            {
                GenerateValidationCodeButton.IsVisible = false;
                BarcodeScanView.IsVisible     = false;
                BarcodeScanView.IsScanning    = false;
                BarcodeImageView.BarcodeValue = _fullChallenge;
                BarcodeImageView.IsVisible    = true;
                ScanResponseButton.IsVisible  = true;
            });
        }
        public async void Handle_OnScanResult(Result result)
        {
            if (string.IsNullOrWhiteSpace(result.Text))
            {
                return;
            }
            var certificate = await _certificateChallengeValidationService.ValidateCertificateAsync(CertificateChallengeService.GetFullChallenge(_currentChallenge), result.Text);

            Device.BeginInvokeOnMainThread(() =>
            {
                BarcodeScanView.IsVisible  = false;
                BarcodeScanView.IsScanning = false;
                BarcodeImageView.IsVisible = false;
                if (certificate != null)
                {
                    ValidationSuccesArea.IsVisible = true;
                    //We need some settings for gateways or gateways for test centre
                    //https://ipfs.github.io/public-gateway-checker/
                    if (certificate.ImmunityCertificate.PhotoId != null && certificate.ImmunityCertificate.PhotoId.Length > 0)
                    {
                        PhotoUser.Source = "https://ipfs.io/ipfs/" + certificate.ImmunityCertificate.PhotoId.EncodeBase58();
                    }
                }
                else // TODO display and throw exceptions with errors whilst validating and restart validation()
                {
                    ValidationFailureArea.IsVisible = true;
                }
            });
        }
 public CheckImmunityCertPage()
 {
     InitializeComponent();
     _certificateChallengeService           = new CertificateChallengeService();
     _certificateChallengeValidationService = new CertificateChallengeValidationService();
 }
 public ProvideProofCertPage()
 {
     InitializeComponent();
     _certificateChallengeService = new CertificateChallengeService();
 }