// Load an existing extension internal void edit(keyUsage ku) { keyUsage = ku; enableEvents = false; // Setup the checkboxes foreach (string _ku in keyUsage.Kusage) { foreach (CheckBox cb in cblist) { if ((string)cb.Tag == _ku) { cb.Checked = true; } } } // critical setting if (keyUsage.Critical) { cbCritical.Checked = true; } else { cbCritical.Checked = false; } enableEvents = true; }
public void keyUsageConstructorTest1() { bool Critical = true; keyUsage target = new keyUsage(Critical); Assert.IsTrue(target.Critical); }
public void KusageTest() { keyUsage target = new keyUsage(testData1); List <string> actual; actual = target.Kusage; Assert.AreEqual("CRLSign", actual[1]); }
public void RemoveTest() { keyUsage target = new keyUsage(testData1); string usage = "KeyCertSign"; target.Remove(usage); Assert.AreEqual(1, target.Kusage.Count); }
public void ToXmlTest() { keyUsage target = new keyUsage(testData1); XNode expected = testData1; XNode actual = target.ToXml(); Assert.AreEqual(expected.ToString(), actual.ToString()); }
public void KeyUsageTest() { keyUsage target = new keyUsage(testData1); KeyUsage actual; actual = target.KeyUsage; Assert.AreEqual(extValue1, actual.ToString()); }
public void AddTest() { keyUsage target = new keyUsage(); string usage = "KeyAgreement"; target.Add(usage); Assert.IsTrue(target.Kusage.Count == 1); Assert.AreEqual("KeyAgreement", target.Kusage[0]); }
public void keyUsageConstructorTest2() { XElement xml = testData1; keyUsage target = new keyUsage(xml); Assert.AreEqual("KeyUsage", target.Name); Assert.AreEqual("Key Usage", target.DisplayName); Assert.IsTrue(target.Critical); Assert.IsTrue(target.Kusage.Count == 2); }
public KeyUsage(keyUsage ku) { InitializeComponent(); cblist = new CheckBox[] { cbDigitalSignature, cbNonRepudiation, cbKeyCertSign, cbDataEncipherment, cbCRLSign, cbDecipherOnly, cbEncipherOnly, cbKeyAgreement, cbKeyEncipherment }; if (ku == null) { create(); } else { edit(ku); } }
public void keyUsageConstructorTest() { keyUsage target = new keyUsage(); Assert.AreEqual("KeyUsage", target.Name); }
// Create a new extension internal void create() { keyUsage = new keyUsage(); enableEvents = true; }