RemoveCertificate() public method

public RemoveCertificate ( Mono.Security.X509.X509Certificate cert ) : void
cert Mono.Security.X509.X509Certificate
return void
Ejemplo n.º 1
0
		public void RemoveCertificate_Test1 ()
		{
			PKCS12 p12 = new PKCS12 ();
			X509Certificate x509 = new X509Certificate (cert);
			p12.AddCertificate (x509);

			AssertEquals ("RC1.1", p12.Certificates.Count, 1);

			p12.RemoveCertificate (x509);

			AssertEquals ("RC1.2", p12.Certificates.Count, 0);
		}
Ejemplo n.º 2
0
		public void RemoveCertificate_Test2 ()
		{
			PKCS12 p12 = new PKCS12 ();
			X509Certificate x509 = new X509Certificate (cert);

			IDictionary attrs = new Hashtable ();
			ArrayList attrValues = new ArrayList ();
			attrValues.Add (Encoding.BigEndianUnicode.GetBytes ("Friendly name"));
			attrs.Add (PKCS9.friendlyName, attrValues);

			p12.AddCertificate (x509, attrs);

			AssertEquals ("RC2.1", p12.Certificates.Count, 1);

			p12.RemoveCertificate (x509, attrs);

			AssertEquals ("RC2.2", p12.Certificates.Count, 0);
		}
Ejemplo n.º 3
0
		public void RemoveCertificate_Test1 ()
		{
			PKCS12 p12 = new PKCS12 ();
			X509Certificate x509 = new X509Certificate (cert);
			p12.AddCertificate (x509);

			Assert.AreEqual (1, p12.Certificates.Count, "RC1.1");

			p12.RemoveCertificate (x509);

			Assert.AreEqual (0, p12.Certificates.Count, "RC1.2");
		}