public AddKeyBag ( |
||
aa | ||
리턴 | void |
public void GetAsymmetricAlgorithm_Test () { 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.AddKeyBag (RSA.Create (), attrs); AssertEquals ("GA.1", p12.Keys.Count, 1); AsymmetricAlgorithm aa = p12.GetAsymmetricAlgorithm (attrs); AssertNotNull ("GA.2", aa); }
public void GetAttributes_Test1 () { PKCS12 p12 = new PKCS12 (); IDictionary attrs = new Hashtable (); ArrayList attrValues = new ArrayList (); attrValues.Add (Encoding.BigEndianUnicode.GetBytes ("Friendly name")); attrs.Add (PKCS9.friendlyName, attrValues); AsymmetricAlgorithm aa = RSA.Create (); p12.AddKeyBag (aa, attrs); AssertEquals ("GA1.1", p12.Keys.Count, 1); IDictionary pattrs = p12.GetAttributes (aa); Assert ("GA1.2", pattrs.Contains (PKCS9.friendlyName)); }
public void RemoveKeyBag_Test () { PKCS12 p12 = new PKCS12 (); p12.AddKeyBag (RSA.Create ()); AssertEquals ("RK.1", p12.Keys.Count, 1); p12.RemoveKeyBag (RSA.Create ()); AssertEquals ("RK.2", p12.Keys.Count, 0); }
public void AddKeyBag_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.AddKeyBag (RSA.Create (), attrs); AssertEquals ("AK2", p12.Keys.Count, 1); }
public void AddKeyBag_Test1 () { PKCS12 p12 = new PKCS12 (); p12.AddKeyBag (RSA.Create ()); AssertEquals ("AK1", p12.Keys.Count, 1); }
public void RemoveKeyBag_Test () { PKCS12 p12 = new PKCS12 (); RSAManaged rsa = new RSAManaged (384); p12.AddKeyBag (rsa); Assert.AreEqual (1, p12.Keys.Count, "RK.1"); RSAManaged rsa2 = new RSAManaged (384); p12.RemoveKeyBag (rsa2); Assert.AreEqual (1, p12.Keys.Count, "RK.2"); p12.RemoveKeyBag (rsa); Assert.AreEqual (0, p12.Keys.Count, "RK.3"); }
public void AddKeyBag_Test1 () { PKCS12 p12 = new PKCS12 (); p12.AddKeyBag (RSA.Create ()); Assert.AreEqual (1, p12.Keys.Count, "AK1"); }