CopyFrom() public method

public CopyFrom ( System asnEncodedData ) : void
asnEncodedData System
return void
		public void CopyFrom_Null ()
		{
			X509BasicConstraintsExtension bc = new X509BasicConstraintsExtension ();
			bc.CopyFrom (null);
		}
		public void WrongAsnEncodedData ()
		{
			AsnEncodedData aed = new AsnEncodedData (new byte[0]);
			X509BasicConstraintsExtension bc = new X509BasicConstraintsExtension (false, true, 1, false);
			bc.CopyFrom (aed); // note: not the same behaviour than using the constructor!
		}
		public void WrongExtension_X509Extension ()
		{
			X509Extension ex = new X509Extension ("1.2.3", new byte[0], true);
			X509BasicConstraintsExtension bc = new X509BasicConstraintsExtension (false, true, 1, false);
			Assert.IsFalse (bc.Critical, "Critical");
			bc.CopyFrom (ex);
			Assert.IsTrue (bc.Critical, "Critical");
			Assert.AreEqual (String.Empty, BitConverter.ToString (bc.RawData), "RawData");
			Assert.AreEqual ("1.2.3", bc.Oid.Value, "Oid.Value");
			Assert.IsNull (bc.Oid.FriendlyName, "Oid.FriendlyName");
		}
		public void WrongExtension_X509Extension_CertificateAuthority ()
		{
			X509Extension ex = new X509Extension ("1.2.3", new byte[0], true);
			X509BasicConstraintsExtension bc = new X509BasicConstraintsExtension ();
			bc.CopyFrom (ex);
			bool b = bc.CertificateAuthority;
		}
		public void WrongExtension_X509KeyUsageExtension ()
		{
			X509KeyUsageExtension ku = new X509KeyUsageExtension ();
			X509BasicConstraintsExtension bc = new X509BasicConstraintsExtension ();
			bc.CopyFrom (ku);
		}