public void CopyFrom_AsnEncodedData() { AsnEncodedData aed = new AsnEncodedData(new Oid("2.5.29.37"), new byte[] { 0x30, 0x05, 0x06, 0x03, 0x2A, 0x03, 0x04 }); // this is recognized as an Enhanced Key Usages extension // FIXME: Don't expect that FriendlyName is English. This test fails under non-English Windows. //Assert.AreEqual ("Unknown Key Usage (1.2.3.4)" + Environment.NewLine, aed.Format (true), "aed.Format(true)"); //Assert.AreEqual ("Unknown Key Usage (1.2.3.4)", aed.Format (false), "aed.Format(false)"); X509Ex ex = new X509Ex(); // but won't be accepted by the CopyFrom method (no a X509Extension) ex.CopyFrom(aed); }
public void ConstructorEmpty () { X509Ex ex = new X509Ex (); Assert.IsFalse (ex.Critical, "Critical"); Assert.IsNull (ex.RawData, "RawData"); Assert.IsNull (ex.Oid, "Oid"); Assert.AreEqual (String.Empty, ex.Format (true), "Format(true)"); Assert.AreEqual (String.Empty, ex.Format (false), "Format(false)"); ex.Critical = true; Assert.IsTrue (ex.Critical, "Critical 2"); ex.Oid = new Oid ("2.5.29.37"); Assert.AreEqual ("2.5.29.37", ex.Oid.Value, "Oid.Value"); Assert.AreEqual ("Enhanced Key Usage", ex.Oid.FriendlyName, "Oid.FriendlyName"); ex.RawData = new byte[] { 0x30, 0x05, 0x06, 0x03, 0x2A, 0x03, 0x04 }; Assert.AreEqual ("Unknown Key Usage (1.2.3.4)" + Environment.NewLine, ex.Format (true), "Format(true)"); Assert.AreEqual ("Unknown Key Usage (1.2.3.4)", ex.Format (false), "Format(false)"); }
public void ConstructorEmpty() { X509Ex ex = new X509Ex(); Assert.IsFalse(ex.Critical, "Critical"); Assert.IsNull(ex.RawData, "RawData"); Assert.IsNull(ex.Oid, "Oid"); Assert.AreEqual(String.Empty, ex.Format(true), "Format(true)"); Assert.AreEqual(String.Empty, ex.Format(false), "Format(false)"); ex.Critical = true; Assert.IsTrue(ex.Critical, "Critical 2"); ex.Oid = new Oid("2.5.29.37"); Assert.AreEqual("2.5.29.37", ex.Oid.Value, "Oid.Value"); // FIXME: Don't expect that FriendlyName is English. This test fails under non-English Windows. //Assert.AreEqual ("Enhanced Key Usage", ex.Oid.FriendlyName, "Oid.FriendlyName"); ex.RawData = new byte[] { 0x30, 0x05, 0x06, 0x03, 0x2A, 0x03, 0x04 }; // FIXME: Don't expect that FriendlyName is English. This test fails under non-English Windows. //Assert.AreEqual ("Unknown Key Usage (1.2.3.4)" + Environment.NewLine, ex.Format (true), "Format(true)"); //Assert.AreEqual ("Unknown Key Usage (1.2.3.4)", ex.Format (false), "Format(false)"); }
public void CopyFrom_Null() { X509Ex ex = new X509Ex(); ex.CopyFrom(null); }
public void CopyFrom_AsnEncodedData () { AsnEncodedData aed = new AsnEncodedData (new Oid ("2.5.29.37"), new byte[] { 0x30, 0x05, 0x06, 0x03, 0x2A, 0x03, 0x04 }); // this is recognized as an Enhanced Key Usages extension // FIXME: Don't expect that FriendlyName is English. This test fails under non-English Windows. //Assert.AreEqual ("Unknown Key Usage (1.2.3.4)" + Environment.NewLine, aed.Format (true), "aed.Format(true)"); //Assert.AreEqual ("Unknown Key Usage (1.2.3.4)", aed.Format (false), "aed.Format(false)"); X509Ex ex = new X509Ex (); // but won't be accepted by the CopyFrom method (no a X509Extension) ex.CopyFrom (aed); }
public void CopyFrom_Null () { X509Ex ex = new X509Ex (); ex.CopyFrom (null); }
public void CopyFrom_AsnEncodedData () { AsnEncodedData aed = new AsnEncodedData (new Oid ("2.5.29.37"), new byte[] { 0x30, 0x05, 0x06, 0x03, 0x2A, 0x03, 0x04 }); // this is recognized as an Enhanced Key Usages extension Assert.AreEqual ("Unknown Key Usage (1.2.3.4)" + Environment.NewLine, aed.Format (true), "aed.Format(true)"); Assert.AreEqual ("Unknown Key Usage (1.2.3.4)", aed.Format (false), "aed.Format(false)"); X509Ex ex = new X509Ex (); // but won't be accepted by the CopyFrom method (no a X509Extension) ex.CopyFrom (aed); }