CopyFrom() public method

public CopyFrom ( AsnEncodedData asnEncodedData ) : void
asnEncodedData AsnEncodedData
return void
		public void CopyFrom_Null ()
		{
			X509SubjectKeyIdentifierExtension ski = new X509SubjectKeyIdentifierExtension ();
			ski.CopyFrom (null);
		}
		public void WrongAsnEncodedData ()
		{
			AsnEncodedData aed = new AsnEncodedData (new byte[0]);
			X509SubjectKeyIdentifierExtension ski = new X509SubjectKeyIdentifierExtension ("www.mono-project.com", false);
			ski.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);
			X509SubjectKeyIdentifierExtension ski = new X509SubjectKeyIdentifierExtension ("www.go-mono.com", false); // odd length
			Assert.IsFalse (ski.Critical, "Critical");
			Assert.AreEqual ("FFFFFFFFFFFFFF", ski.SubjectKeyIdentifier, "SubjectKeyIdentifier");
			Assert.AreEqual ("ff ff ff ff ff ff ff" + Environment.NewLine, ski.Format (true), "Format(true)");
			Assert.AreEqual ("ff ff ff ff ff ff ff", ski.Format (false), "Format(false)");

			ski.CopyFrom (ex);
			Assert.IsTrue (ski.Critical, "Critical");
			Assert.AreEqual (String.Empty, BitConverter.ToString (ski.RawData), "RawData");
			Assert.AreEqual ("1.2.3", ski.Oid.Value, "Oid.Value");
			// FIXME: Don't expect that FriendlyName is English. This test fails under non-English Windows.
			//Assert.IsNull (ski.Oid.FriendlyName, "Oid.FriendlyName");
			Assert.AreEqual (String.Empty, ski.Format (true), "Format(true)");
			Assert.AreEqual (String.Empty, ski.Format (false), "Format(false)");
		}
		public void WrongExtension_X509Extension_CertificateAuthority ()
		{
			X509Extension ex = new X509Extension ("1.2.3", new byte[0], true);
			X509SubjectKeyIdentifierExtension ski = new X509SubjectKeyIdentifierExtension ();
			ski.CopyFrom (ex);
			string s = ski.SubjectKeyIdentifier;
		}
		public void WrongExtension_X509KeyUsageExtension ()
		{
			X509KeyUsageExtension ku = new X509KeyUsageExtension ();
			X509SubjectKeyIdentifierExtension ski = new X509SubjectKeyIdentifierExtension ();
			ski.CopyFrom (ku);
		}