AddSecretBag() 공개 메소드

public AddSecretBag ( byte secret ) : void
secret byte
리턴 void
예제 #1
0
		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");
		}
예제 #2
0
		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");
		}
예제 #3
0
		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");
		}
예제 #4
0
		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");
		}