// Load an existing extension private void edit(subjectInfoAccess infoAccess) { sia = infoAccess; // Populate the dataset for (int i = 0; i < sia.SubjectInfoAccess.Count; i++) { updateDataSet(sia.SubjectInfoAccess[i].Method, sia.SubjectInfoAccess[i].Location, i); } if (ds.Tables["caRepository"].Rows.Count > 0) { cbCaRepository.Checked = true; } if (ds.Tables["timeStamping"].Rows.Count > 0) { cbTimeStamping.Checked = true; } // critical setting if (sia.Critical) { cbCritical.Checked = true; } else { cbCritical.Checked = false; } }
public void encodeTest1() { subjectInfoAccess target = new subjectInfoAccess(testData1); SubjectInformationAccess actual = target.SubjectInformationAccess; Assert.IsInstanceOfType(actual, typeof(SubjectInformationAccess)); }
public void subjectInfoAccessConstructorTest2() { subjectInfoAccess target = new subjectInfoAccess(testData1); Assert.IsFalse(target.Critical); Assert.AreEqual(testData1.ToString(), target.ToXml().ToString()); }
public void subjectInfoAccessConstructorTest1() { bool critical = false; subjectInfoAccess target = new subjectInfoAccess(critical); Assert.IsFalse(target.Critical); }
public void subjectInfoAccessConstructorTest() { subjectInfoAccess target = new subjectInfoAccess(); target.Add(testData2); target.Add(testData3); Assert.AreEqual(testData1.ToString(), target.ToXml().ToString()); }
public void subjectInfoAccessConstructorTest3() { // Build an extension BcV3CertGen gen = new BcV3CertGen(); subjectInfoAccess testExt = new subjectInfoAccess(testData1); gen.AddExtension(testExt.OID, testExt.Critical, testExt.DerEncoding); X509Certificate cert = CertTestHarness.RunCertGenerator(gen); X509Extension ext = CertTestHarness.ExtractExtension(cert, X509Extensions.SubjectInfoAccess); // Test code subjectInfoAccess target = new subjectInfoAccess(ext); List <AccessDesc> list = target.SubjectInfoAccess; Assert.IsFalse(target.Critical); Assert.AreEqual(2, list.Count); }
public SubjectInfoAccess(subjectInfoAccess InfoAccess) { InitializeComponent(); // Setup the dataset ds.Tables.Add("caRepository"); ds.Tables["caRepository"].Columns.Add("#"); ds.Tables["caRepository"].Columns.Add("Type"); ds.Tables["caRepository"].Columns.Add("Name"); ds.Tables.Add("timeStamping"); ds.Tables["timeStamping"].Columns.Add("#"); ds.Tables["timeStamping"].Columns.Add("Type"); ds.Tables["timeStamping"].Columns.Add("Name"); // Setup the grid dgvCaRepository.Refresh(); dgvCaRepository.DataSource = ds.Tables["caRepository"]; //dgvCaIssuers.Columns[0].Width = 30; dgvTimeStamping.DataSource = ds.Tables["timeStamping"]; //dgvOcsp.Columns[0].Width = 30; // Setup the buttons 'n stuff butAddCaRepository.Enabled = false; butAddTimeStamping.Enabled = false; butRemoveCaRepository.Enabled = false; butRemoveTimeStamping.Enabled = false; if (InfoAccess == null) { create(); } else { edit(InfoAccess); } }
// Create a new extension private void create() { sia = new subjectInfoAccess(); }