コード例 #1
0
		/// <summary>
		/// Constructor used for initializing ASN.1's type class with
		/// BER code normally calls this method.
		/// This method explicitly initializes OctetString's data 
		/// member from BER code.
		/// </summary>
		/// <param name="ulazBER">input BER code</param>
		public override void fromBER(BEREncoding ulazBER)
		{
			/// invoke ulazBER's Decode() method.
			//base.fromBER (ulazBER);

			this.OctetString =  ulazBER.GetContents();
		}
コード例 #2
0
		public override void fromBER(BEREncoding ulazBER) 
		{
			Byte[] tmp;
			int i;
		
			base.fromBER (ulazBER);

			tmp = ulazBER.GetContents();

			this.NumOfBits = (tmp.Length-1)*8 - tmp[0];
			this.bitString = new Byte[tmp.Length - 1];
			for (i=0;i<this.bitString.Length; i++) 
			{
				this.bitString[i]=tmp[i+1];
			}
        
		
		}
コード例 #3
0
		public sealed override void fromBER(BEREncoding ulazBER)
		{
			BEREncoding under_ber = new BEREncoding(ulazBER.GetContents());
			this.Assign(this.type.CreateInstance(under_ber));
		}
コード例 #4
0
		public override void fromBER(BEREncoding ulazBER)
		{
			ulazBER.Decode();

			this.val = (ulazBER.GetContents()[0] != 0x00);
		}
コード例 #5
0
		public override void fromBER(BEREncoding ulazBER) 
		{
			

			ulazBER.Decode();
			byte[] tmparray = ulazBER.GetContents();
			ArrayList list = new ArrayList();
			
			/// procitaj Contents i prebaci u values...
			/// 

			list.Add(tmparray[0] / 40);
			list.Add(tmparray[0] % 40);

			/// Dekodiraj onaj nespretni zapis u bazi 128 
			
			int i=1, loop = tmparray.Length;
			
			int val, 
				tmpval, 
				sizea=2; /// To su ona dva obavezna, vec ranije obradjena

			while (i < loop)
			{
			
				val = 0;
				
				while (tmparray[i] > 127)
				{
					tmpval = (int) (tmparray[i] & 0x7f);
					
					val <<= 7;
					val |= tmpval;
					
					i++;
				};

				val <<= 7;
				val |= tmparray[i];				
				
				list.Add(val);
				sizea++;
				i++;
			}

			this.Values = new int[sizea];
			list.CopyTo(0, this.Values, 0, sizea);
		}