Exemplo n.º 1
0
		public void Test_ValuesWithContext()
		{
			ValuesWithContext v1;

			UNIQUE_TypeInfo uti = new UNIQUE_TypeInfo(Sets.SupportedAttributes);
			uti.uoid = new oid(2, 3, 4);

			///* dakle sad kad iniciram ValuesWithContext sa ovim UNIQUE objektom
			///  podtip mora biti Boolean
			
			v1 = new ValuesWithContext(uti);

			v1.Add(ASN1Boolean.FALSE);

			BERWriter.DumpHEX(v1);


			/* ------------------- */
			/* ... ovdje imam ValuesWithContext instancu... koja nije parametrizirana, a dependent je type..
			 */

			System.Console.WriteLine("\nDifferent kind of test");

			ValuesWithContext v2 = new ValuesWithContext();
			v2.Add(ASN1Boolean.FALSE);

			BERWriter.DumpHEX(v2);

			BEREncoding ber = v2.asDER();

			ValuesWithContext v3 = new ValuesWithContext();
			v3.SetType(new ASN1Any_type(uti));

			v3.fromBER(ber);

			BERWriter.DumpHEX(v3);
			
		}
		public ValuesWithContext_type(UNIQUE_TypeInfo uti):base(uti)
		{
			this.Tag = (int) ASN1TagNumber.SetTag;
		}
		public ValuesWithContext(UNIQUE_TypeInfo u_ti):base(0,6)
		{
			///this.Max_Elements = 6;
			this.type = new ASN1Any_type(u_ti);
		}