private async void ExportCertificateDetailsAsync(CertificateSelector sender, CertificateSelector.CertificateDetails certificateData)
        {
            MessageBox.Show("Exporting certificate details from the device to Azure storage...");
            string targetFileName          = certificateData.Hash + ".json";
            DeviceMethodReturnValue result = await RequestCertificateDetailsAsync(AzureStorageDesiredConnectionString.Text, AzureStorageContainerName.Text, sender.CertificatesPath, certificateData.Hash, targetFileName);

            GetCertificateDetailsResponse response = JsonConvert.DeserializeObject <GetCertificateDetailsResponse>(result.Payload);

            if (response == null || response.Status != 0)
            {
                MessageBox.Show("Error: could not schedule certificate export");
                return;
            }

            CertificateExportDetails.CertificateExportDetailsData certificateExportDetailsData = new CertificateExportDetails.CertificateExportDetailsData();
            certificateExportDetailsData.ConnectionString = AzureStorageDesiredConnectionString.Text;
            certificateExportDetailsData.ContainerName    = AzureStorageContainerName.Text;
            certificateExportDetailsData.BlobName         = targetFileName;

            CertificateExportDetails certificateExportDetails = new CertificateExportDetails();

            certificateExportDetails.Owner       = this;
            certificateExportDetails.DataContext = certificateExportDetailsData;
            certificateExportDetails.Show();
        }
        private void ShowCertificateDetails(CertificateSelector sender, CertificateSelector.CertificateDetails certificateData)
        {
            CertificateDetails certificateDetails = new CertificateDetails();

            certificateDetails.Owner       = this;
            certificateDetails.DataContext = certificateData;
            certificateDetails.ShowDialog();
        }
 private void CertificateInfoToUI(List <string> hashes, CertificateSelector certificateSelector)
 {
     if (hashes == null)
     {
         return;
     }
     hashes.Sort();
     if (certificateSelector != null)
     {
         List <CertificateSelector.CertificateDetails> certificateList = new List <CertificateSelector.CertificateDetails>();
         foreach (string hash in hashes)
         {
             CertificateSelector.CertificateDetails certificateData = new CertificateSelector.CertificateDetails();
             certificateData.Hash     = hash;
             certificateData.FileName = "<unknown>";
             certificateList.Add(certificateData);
         }
         certificateSelector.SetCertificateList(certificateList);
     }
 }
 private void ExportCertificateDetails(CertificateSelector sender, CertificateSelector.CertificateDetails certificateData)
 {
     ExportCertificateDetailsAsync(sender, certificateData);
 }