public void extendedKeyUsageConstructorTest1() { bool Critical = true; extendedKeyUsage target = new extendedKeyUsage(Critical); Assert.IsTrue(target.Critical); }
public void extendedKeyUsageConstructorTest() { XElement xml = testData1; extendedKeyUsage target = new extendedKeyUsage(xml); Assert.AreEqual(target.ToXml().ToString(), testData1.ToString()); }
// Load an existing extension internal void edit(extendedKeyUsage eku) { extKeyUsage = eku; enableEvents = false; // Setup the checkboxes foreach (string _eku in extKeyUsage.ExtKUsage) { foreach (CheckBox cb in cblist) { if ((string)cb.Tag == _eku) { cb.Checked = true; } } } // critical setting if (extKeyUsage.Critical) { cbCritical.Checked = true; } else { cbCritical.Checked = false; } enableEvents = true; }
public ExtendedKeyUsage(extendedKeyUsage eku) { InitializeComponent(); cblist = new CheckBox[] { cbAnyExtendedKeyUsage, cbServerAuth, cbClientAuth, cbCodeSigning, cbEmailProtection, cbIpsecEndSystem, cbIpsecTunnel, cbIpsecUser, cbTimeStamping, cbOcspSigning, cbSmartCardLogon }; if (eku == null) { create(); } else { edit(eku); } }
public void RemoveTest() { extendedKeyUsage target = new extendedKeyUsage(testData1); string value = "ServerAuth"; target.Remove(value); Assert.AreEqual(1, target.ExtKUsage.Count); }
public void ExtendedKeyUsageTest() { extendedKeyUsage target = new extendedKeyUsage(testData1); ExtendedKeyUsage actual; actual = target.ExtendedKeyUsage; Assert.IsInstanceOfType(actual, typeof(ExtendedKeyUsage)); Assert.AreEqual(2, actual.Count); }
public void ToXmlTest() { extendedKeyUsage target = new extendedKeyUsage(testData1); XNode expected = testData1; XNode actual; actual = target.ToXml(); Assert.AreEqual(expected.ToString(), actual.ToString()); }
public void AddTest() { extendedKeyUsage target = new extendedKeyUsage(); string value = "CodeSigning"; target.Add(value); Assert.AreEqual(1, target.ExtKUsage.Count); Assert.AreEqual("CodeSigning", target.ExtKUsage[0]); }
public void extendedKeyUsageConstructorTest3() { // Build an extension BcV3CertGen gen = new BcV3CertGen(); extendedKeyUsage testExt = new extendedKeyUsage(testData1); gen.AddExtension(testExt.OID, testExt.Critical, testExt.DerEncoding); X509Certificate cert = CertTestHarness.RunCertGenerator(gen); X509Extension ext = CertTestHarness.ExtractExtension(cert, X509Extensions.ExtendedKeyUsage); // Test code extendedKeyUsage target = new extendedKeyUsage(ext); List <string> list = target.ExtKUsage; Assert.IsFalse(target.Critical); Assert.AreEqual(2, list.Count); Assert.AreEqual("ClientAuth", list[0]); Assert.AreEqual("ServerAuth", list[1]); }
public void extendedKeyUsageConstructorTest2() { extendedKeyUsage target = new extendedKeyUsage(); Assert.IsFalse(target.Critical); }
// Create a new extension internal void create() { extKeyUsage = new extendedKeyUsage(); enableEvents = true; }