public void SecretBagImportExport_Test1 () { PKCS12 p12_1 = new PKCS12 (); p12_1.AddSecretBag (secret); Assert.AreEqual (1, p12_1.Secrets.Count, "SBIE1.1"); byte[] buf = p12_1.GetBytes (); PKCS12 p12_2 = new PKCS12 (buf); Assert.AreEqual (1, p12_2.Secrets.Count, "SBIE1.2"); Assert.AreEqual (p12_2.Secrets [0] as byte[], secret, "SBIE1.3"); }
public void AddSecretBag_Test2 () { PKCS12 p12 = new PKCS12 (); IDictionary attrs = new Hashtable (); ArrayList attrValues = new ArrayList (); attrValues.Add (Encoding.BigEndianUnicode.GetBytes ("Friendly name")); attrs.Add (PKCS9.friendlyName, attrValues); p12.AddSecretBag (secret, attrs); Assert.AreEqual (1, p12.Secrets.Count, "ASB2.1"); Assert.AreEqual (p12.Secrets [0] as byte[], secret, "ASB2.2"); }
public void RemoveSecretBag_Test1 () { PKCS12 p12 = new PKCS12 (); p12.AddSecretBag (secret); Assert.AreEqual (1, p12.Secrets.Count, "RSB1.1"); p12.RemoveSecretBag (secret); Assert.AreEqual (0, p12.Secrets.Count, "RSB1.2"); }
public void AddSecretBag_Test1 () { PKCS12 p12 = new PKCS12 (); p12.AddSecretBag (secret); Assert.AreEqual (1, p12.Secrets.Count, "ASB1.1"); Assert.AreEqual (p12.Secrets [0] as byte[], secret, "ASB1.2"); }