Esempio n. 1
0
        private void btnCreatCard_Click(object sender, EventArgs e)
        {
            InformationCard ic = PopulateCard();

            saveFileDialog1.Filter = "Managed Card|*.crd";
            DialogResult dr = saveFileDialog1.ShowDialog();

            string    filename  = saveFileDialog1.FileName;
            StoreName storeName = StoreName.My;

            X509Certificate2 certificate = ManagedCardHelper.RetrieveCertificate(tbCertificatePath.Text);



            ManagedCardHelper.SaveCard(ic, certificate, filename);
        }
Esempio n. 2
0
        private void btnCreatCard_Click(object sender, EventArgs e)
        {
            InformationCardTemplate ict = PopulateCardTemplateFromUI();

            saveFileDialog1.Filter = "Managed Card (*.crd)|*.crd";
            DialogResult dr = saveFileDialog1.ShowDialog();

            string filename = saveFileDialog1.FileName;

            CertificateInfo certInfo = new CertificateInfo();

            certInfo.CommonName = tbCertificateCommonName.Text;
            certInfo.Location   = tbCertificateLocation.Text;
            certInfo.Store      = tbCertificateStore.Text;
            X509Certificate2 certificate = ManagedCardHelper.RetrieveCertificate(certInfo);

            ManagedCardHelper helper = new ManagedCardHelper();

            helper.SaveCard(ict.InformationCardDefinition, certificate, filename);
        }