taggedValue() публичный Метод

Returns the Asn1Object stored in this Asn1Tagged object
public taggedValue ( ) : Asn1Object
Результат Asn1Object
Пример #1
0
        public DebugParameter(Asn1Tagged dseObject)
        {
            switch ((DebugParameterType)(dseObject.getIdentifier().Tag))
              {
              case DebugParameterType.ENTRYID:
              case DebugParameterType.INTEGER:
            objData = getTaggedIntValue(dseObject);
            break;

              case DebugParameterType.BINARY:
            objData = ((Asn1OctetString) dseObject.taggedValue()).byteValue();
            break;

              case DebugParameterType.STRING:
            objData = ((Asn1OctetString) dseObject.taggedValue()).stringValue();
            break;

              case DebugParameterType.TIMESTAMP:
            objData = new DSETimeStamp(getTaggedSequence(dseObject));
            break;

              case DebugParameterType.TIMEVECTOR:
            ArrayList timeVector = new ArrayList();
            Asn1Sequence seq = getTaggedSequence(dseObject);
            int count = ((Asn1Integer) seq.get_Renamed(0)).intValue();
            if (count > 0)
            {
              Asn1Sequence timeSeq = (Asn1Sequence) seq.get_Renamed(1);

              for (int i = 0; i < count; i++)
              {
            timeVector.Add(new DSETimeStamp((Asn1Sequence) timeSeq.get_Renamed(i)));
              }
            }

            objData = timeVector;
            break;

              case DebugParameterType.ADDRESS:
            objData = new ReferralAddress(getTaggedSequence(dseObject));
            break;

              default:
            throw new IOException("Unknown Tag in DebugParameter..");
              }

              debug_type = (DebugParameterType)(dseObject.getIdentifier().Tag);
        }
Пример #2
0
        /// <summary> Encode an Asn1Tagged directly into the specified outputstream.</summary>
        public void encode(Asn1Tagged t, Stream out_Renamed)
        {
            if (t.Explicit)
            {
                encode(t.getIdentifier(), out_Renamed);

                /* determine the encoded length of the base type. */
                MemoryStream encodedContent = new MemoryStream();
                t.taggedValue().encode(this, encodedContent);

                encodeLength((int)encodedContent.Length, out_Renamed);
                sbyte[] temp_sbyteArray;
                temp_sbyteArray = SupportClass.ToSByteArray(encodedContent.ToArray());
                out_Renamed.Write(SupportClass.ToByteArray(temp_sbyteArray), 0, temp_sbyteArray.Length);
            }
            else
            {
                t.taggedValue().encode(this, out_Renamed);
            }
        }
Пример #3
0
		/// <summary> Encode an Asn1Tagged directly into the specified outputstream.</summary>
		public void  encode(Asn1Tagged t, System.IO.Stream out_Renamed)
		{
			if (t.Explicit)
			{
				encode(t.getIdentifier(), out_Renamed);
				
				/* determine the encoded length of the base type. */
				System.IO.MemoryStream encodedContent = new System.IO.MemoryStream();
				t.taggedValue().encode(this, encodedContent);
				
				encodeLength((int)encodedContent.Length, out_Renamed);
				sbyte[] temp_sbyteArray;
				temp_sbyteArray = SupportClass.ToSByteArray(encodedContent.ToArray());
				out_Renamed.Write(SupportClass.ToByteArray(temp_sbyteArray), 0, temp_sbyteArray.Length);;;;
			}
			else
			{
				t.taggedValue().encode(this, out_Renamed);
			}
			return ;
		}
Пример #4
0
        protected Asn1Sequence getTaggedSequence(Asn1Tagged tagVal)
        {
            Asn1Object obj = tagVal.taggedValue();
              byte[] dataBytes = SupportClass.ToByteArray(((Asn1OctetString) obj).byteValue());

              MemoryStream decodedData = new MemoryStream(dataBytes);
              LBERDecoder decoder = new LBERDecoder();

              return new Asn1Sequence(decoder, decodedData, dataBytes.Length);
        }
Пример #5
0
        protected int getTaggedIntValue(Asn1Tagged tagVal)
        {
            Asn1Object obj = tagVal.taggedValue();
              byte[] dataBytes = SupportClass.ToByteArray(((Asn1OctetString) obj).byteValue());

              MemoryStream decodedData = new MemoryStream(dataBytes);
              LBERDecoder decoder = new LBERDecoder();

              return ((int) decoder.decodeNumeric(
                decodedData,
                dataBytes.Length));
        }
Пример #6
0
        protected string getTaggedStringValue(Asn1Tagged tagvalue, GeneralEventField tagid)
        {
            Asn1Object obj = tagvalue.taggedValue();

              if ((int)tagid != tagvalue.getIdentifier().Tag)
              {
            throw new IOException("Unknown Tagged Data");
              }

              byte[] dbytes = SupportClass.ToByteArray(((Asn1OctetString) obj).byteValue());
              MemoryStream data = new MemoryStream(dbytes);

              LBERDecoder dec = new LBERDecoder();

              int length = dbytes.Length;

              return (string) dec.decodeCharacterString(data, length);
        }