Exemplo n.º 1
0
        public RfcExtendedResponse(Asn1Decoder dec, System.IO.Stream in_Renamed, int len) : base(dec, in_Renamed, len)
        {
            // decode optional tagged elements
            if (size() > 3)
            {
                for (int i = 3; i < size(); i++)
                {
                    Asn1Tagged     obj = (Asn1Tagged)get_Renamed(i);
                    Asn1Identifier id  = obj.getIdentifier();
                    switch (id.Tag)
                    {
                    case RfcLdapResult.REFERRAL:
                        sbyte[] content             = ((Asn1OctetString)obj.taggedValue()).byteValue();
                        System.IO.MemoryStream bais = new System.IO.MemoryStream(SupportClass.ToByteArray(content));
                        set_Renamed(i, new RfcReferral(dec, bais, content.Length));
                        referralIndex = i;
                        break;

                    case RESPONSE_NAME:
                        set_Renamed(i, new RfcLdapOID(((Asn1OctetString)obj.taggedValue()).byteValue()));
                        responseNameIndex = i;
                        break;

                    case RESPONSE:
                        set_Renamed(i, obj.taggedValue());
                        responseIndex = i;
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates and adds a present matching to the filter.
        /// </summary>
        /// <param name="attrName">Name of the attribute to check for presence.</param>
        public void AddPresent(string attrName)
        {
            Asn1Object current = new Asn1Tagged(
                new Asn1Identifier((int)FilterOp.Present),
                new Asn1OctetString(attrName),
                false);

            AddObject(current);
        }
Exemplo n.º 3
0
        protected Asn1Sequence getTaggedSequence(Asn1Tagged tagVal)
        {
            var obj       = tagVal.taggedValue();
            var dataBytes = SupportClass.ToByteArray(((Asn1OctetString)obj).byteValue());

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

            return(new Asn1Sequence(decoder, decodedData, dataBytes.Length));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates and addes a substrings filter component.
        /// startSubstrings must be immediatly followed by at least one
        /// <c>AddSubstring</c> method and one <c>EndSubstrings</c> method
        /// </summary>
        /// <param name="attrName">Name of the attribute.</param>
        public void StartSubstrings(string attrName)
        {
            _finalFound = false;
            var        seq     = new Asn1SequenceOf(5);
            Asn1Object current =
                new Asn1Tagged(new Asn1Identifier((int)FilterOp.Substrings, true),
                               new RfcSubstringFilter(attrName, seq),
                               false);

            AddObject(current);
            _filterStack.Push(seq);
        }
Exemplo n.º 5
0
        protected int getTaggedIntValue(Asn1Tagged tagVal)
        {
            var obj       = tagVal.taggedValue();
            var dataBytes = SupportClass.ToByteArray(((Asn1OctetString)obj).byteValue());

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

            return((int)decoder.decodeNumeric(
                       decodedData,
                       dataBytes.Length));
        }
Exemplo n.º 6
0
 public RfcBindResponse(Asn1Decoder dec, System.IO.Stream in_Renamed, int len) : base(dec, in_Renamed, len)
 {
     // Decode optional referral from Asn1OctetString to Referral.
     if (size() > 3)
     {
         Asn1Tagged     obj = (Asn1Tagged)get_Renamed(3);
         Asn1Identifier id  = obj.getIdentifier();
         if (id.Tag == RfcLdapResult.REFERRAL)
         {
             sbyte[] content             = ((Asn1OctetString)obj.taggedValue()).byteValue();
             System.IO.MemoryStream bais = new System.IO.MemoryStream(SupportClass.ToByteArray(content));
             set_Renamed(3, new RfcReferral(dec, bais, content.Length));
         }
     }
 }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        /// <summary>
        ///     Creates and adds an AttributeValueAssertion to the filter.
        /// </summary>
        /// <param name="rfcType">
        ///     Filter type: EQUALITY_MATCH | GREATER_OR_EQUAL
        ///     | LESS_OR_EQUAL | APPROX_MATCH ].
        /// </param>
        /// <param name="attrName">Name of the attribute to be asserted.</param>
        /// <param name="valueArray">Value of the attribute to be asserted.</param>
        /// <exception cref="LdapException">
        ///     Cannot insert an attribute assertion in a substring
        ///     or
        ///     Invalid filter type for AttributeValueAssertion.
        /// </exception>
        public void AddAttributeValueAssertion(FilterOp rfcType, string attrName, sbyte[] valueArray)
        {
            if (_filterStack != null && _filterStack.Count != 0 && _filterStack.Peek() is Asn1SequenceOf)
            {
                throw new LdapException("Cannot insert an attribute assertion in a substring", LdapStatusCode.FilterError);
            }

            if (rfcType != FilterOp.EqualityMatch && rfcType != FilterOp.GreaterOrEqual && rfcType != FilterOp.LessOrEqual && rfcType != FilterOp.ApproxMatch)
            {
                throw new LdapException("Invalid filter type for AttributeValueAssertion", LdapStatusCode.FilterError);
            }

            Asn1Object current = new Asn1Tagged(new Asn1Identifier((int)rfcType, true), new RfcAttributeValueAssertion(attrName, valueArray), false);

            AddObject(current);
        }
Exemplo n.º 9
0
        protected Asn1Sequence getTaggedSequence(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(new Asn1Sequence(dec, data, length));
        }
Exemplo n.º 10
0
        protected string getTaggedStringValue(Asn1Tagged tagvalue, GeneralEventField tagid)
        {
            var obj = tagvalue.taggedValue();

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

            var dbytes = SupportClass.ToByteArray(((Asn1OctetString)obj).byteValue());
            var data   = new MemoryStream(dbytes);

            var dec = new LBERDecoder();

            var length = dbytes.Length;

            return((string)dec.decodeCharacterString(data, length));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Encode an Asn1Tagged directly into the specified outputstream.
        /// </summary>
        /// <param name="t">The Asn1Tagged object to encode</param>
        /// <param name="stream">The stream.</param>
        public void Encode(Asn1Tagged t, Stream stream)
        {
            if (t.Explicit)
            {
                Encode(t.GetIdentifier(), stream);

                // determine the encoded length of the base type.
                var encodedContent = new MemoryStream();
                t.TaggedValue.Encode(this, encodedContent);

                EncodeLength((int)encodedContent.Length, stream);
                var tempSbyteArray = encodedContent.ToArray().ToSByteArray();
                stream.Write(tempSbyteArray.ToByteArray(), 0, tempSbyteArray.Length);
            }
            else
            {
                t.TaggedValue.Encode(this, stream);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Creates and adds the Asn1Tagged value for a nestedFilter: AND, OR, or
        /// NOT.
        /// Note that a Not nested filter can only have one filter, where AND
        /// and OR do not
        /// </summary>
        /// <param name="rfcType">Filter type:
        /// [AND | OR | NOT]</param>
        /// <exception cref="LdapException">Attempt to create a nested filter other than AND, OR or NOT</exception>
        public void StartNestedFilter(FilterOp rfcType)
        {
            Asn1Object current;

            if (rfcType == FilterOp.And || rfcType == FilterOp.Or)
            {
                current = new Asn1Tagged(new Asn1Identifier((int)rfcType, true), new Asn1SetOf(), false);
            }
            else if (rfcType == FilterOp.Not)
            {
                current = new Asn1Tagged(new Asn1Identifier((int)rfcType, true));
            }
            else
            {
                throw new LdapException("Attempt to create a nested filter other than AND, OR or NOT",
                                        LdapStatusCode.FilterError);
            }

            AddObject(current);
        }
Exemplo n.º 13
0
        public RfcIntermediateResponse(Asn1Decoder dec, Stream in_Renamed, int len)
            : base(dec, in_Renamed, len)
            //		throws IOException
        {
            //		super(dec, in, len);

            int i = 0;

            m_responseNameIndex = m_responseValueIndex = 0;

            // decode optional tagged elements. The parent class constructor will
            // have decoded these elements as ASN1Tagged objects with the value
            // stored as an ASN1OctectString object.

            if (size() >= 3) //the incorrectly encoded case, LDAPResult contains
            {
                i = 3;       //at least 3 components
            }
            else
            {
                i = 0; //correctly encoded case, can have zero components
            }
            for (; i < size(); i++)
            {
                Asn1Tagged     obj = (Asn1Tagged)get_Renamed(i);
                Asn1Identifier id  = obj.getIdentifier();
                switch (id.Tag)
                {
                case TAG_RESPONSE_NAME:
                    set_Renamed(i, new RfcLdapOID(
                                    ((Asn1OctetString)obj.taggedValue()).byteValue()));
                    m_responseNameIndex = i;
                    break;

                case TAG_RESPONSE:
                    set_Renamed(i, obj.taggedValue());
                    m_responseValueIndex = i;
                    break;
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        ///     Creates and adds the Asn1Tagged value for a nestedFilter: AND, OR, or
        ///     NOT.
        ///     Note that a Not nested filter can only have one filter, where AND
        ///     and OR do not.
        /// </summary>
        /// <param name="rfcType">
        ///     Filter type:
        ///     [AND | OR | NOT].
        /// </param>
        /// <exception cref="LdapException">Attempt to create a nested filter other than AND, OR or NOT.</exception>
        public void StartNestedFilter(FilterOp rfcType)
        {
            Asn1Object current;

            switch (rfcType)
            {
            case FilterOp.And:
            case FilterOp.Or:
                current = new Asn1Tagged(new Asn1Identifier((int)rfcType, true), new Asn1SetOf(), false);
                break;

            case FilterOp.Not:
                current = new Asn1Tagged(new Asn1Identifier((int)rfcType, true));
                break;

            default:
                throw new LdapException("Attempt to create a nested filter other than AND, OR or NOT", LdapStatusCode.FilterError);
            }

            AddObject(current);
        }
Exemplo n.º 15
0
        private Asn1Tagged ParseFilterComp()
        {
            Asn1Tagged tag        = null;
            var        filterComp = (FilterOp)_ft.OpOrAttr;

            switch (filterComp)
            {
            case FilterOp.And:
            case FilterOp.Or:
                tag = new Asn1Tagged(new Asn1Identifier((int)filterComp, true),
                                     ParseFilterList(),
                                     false);
                break;

            case FilterOp.Not:
                tag = new Asn1Tagged(new Asn1Identifier((int)filterComp, true),
                                     ParseFilter());
                break;

            default:
                var filterType   = _ft.FilterType;
                var valueRenamed = _ft.Value;

                switch (filterType)
                {
                case FilterOp.GreaterOrEqual:
                case FilterOp.LessOrEqual:
                case FilterOp.ApproxMatch:
                    tag = new Asn1Tagged(new Asn1Identifier((int)filterType, true),
                                         new RfcAttributeValueAssertion(_ft.Attr, UnescapeString(valueRenamed)),
                                         false);
                    break;

                case FilterOp.EqualityMatch:
                    if (valueRenamed.Equals("*"))
                    {
                        // present
                        tag = new Asn1Tagged(
                            new Asn1Identifier((int)FilterOp.Present),
                            new Asn1OctetString(_ft.Attr),
                            false);
                    }
                    else if (valueRenamed.IndexOf('*') != -1)
                    {
                        var sub     = new Tokenizer(valueRenamed, "*", true);
                        var seq     = new Asn1SequenceOf(5);
                        var tokCnt  = sub.Count;
                        var cnt     = 0;
                        var lastTok = new StringBuilder(string.Empty).ToString();
                        while (sub.HasMoreTokens())
                        {
                            var subTok = sub.NextToken();
                            cnt++;
                            if (subTok.Equals("*"))
                            {
                                // if previous token was '*', and since the current
                                // token is a '*', we need to insert 'any'
                                if (lastTok.Equals(subTok))
                                {
                                    // '**'
                                    seq.Add(new Asn1Tagged(
                                                new Asn1Identifier((int)SubstringOp.Any),
                                                UnescapeString(string.Empty)));
                                }
                            }
                            else
                            {
                                // value (RfcLdapString)
                                if (cnt == 1)
                                {
                                    // initial
                                    seq.Add(new Asn1Tagged(
                                                new Asn1Identifier((int)SubstringOp.Initial),
                                                UnescapeString(subTok)));
                                }
                                else if (cnt < tokCnt)
                                {
                                    // any
                                    seq.Add(new Asn1Tagged(
                                                new Asn1Identifier((int)SubstringOp.Any),
                                                UnescapeString(subTok)));
                                }
                                else
                                {
                                    // final
                                    seq.Add(new Asn1Tagged(
                                                new Asn1Identifier((int)SubstringOp.Final),
                                                UnescapeString(subTok)));
                                }
                            }

                            lastTok = subTok;
                        }

                        tag = new Asn1Tagged(
                            new Asn1Identifier((int)FilterOp.Substrings, true),
                            new RfcSubstringFilter(_ft.Attr, seq),
                            false);
                    }
                    else
                    {
                        tag = new Asn1Tagged(
                            new Asn1Identifier((int)FilterOp.EqualityMatch, true),
                            new RfcAttributeValueAssertion(_ft.Attr, UnescapeString(valueRenamed)),
                            false);
                    }

                    break;

                case FilterOp.ExtensibleMatch:
                    string type = null, matchingRule = null;
                    var    attr  = false;
                    var    st    = new Tokenizer(_ft.Attr, ":");
                    var    first = true;

                    while (st.HasMoreTokens())
                    {
                        var s = st.NextToken().Trim();
                        if (first && !s.Equals(":"))
                        {
                            type = s;
                        }
                        else if (s.Equals("dn"))
                        {
                            attr = true;
                        }
                        else if (!s.Equals(":"))
                        {
                            matchingRule = s;
                        }

                        first = false;
                    }

                    tag = new Asn1Tagged(
                        new Asn1Identifier((int)FilterOp.ExtensibleMatch, true),
                        new RfcMatchingRuleAssertion(matchingRule, type, UnescapeString(valueRenamed), attr == false ? null : new Asn1Boolean(true)),
                        false);

                    break;
                }

                break;
            }

            return(tag);
        }
Exemplo n.º 16
0
 public FilterIterator(RfcFilter enclosingInstance, Asn1Tagged root)
 {
     _enclosingInstance = enclosingInstance;
     _root = root;
 }
Exemplo n.º 17
0
        public RfcLdapMessage(Asn1Decoder dec, Stream in_Renamed, int len) : base(dec, in_Renamed, len)
        {
            sbyte[]      content;
            MemoryStream bais;

            // Decode implicitly tagged protocol operation from an Asn1Tagged type
            // to its appropriate application type.
            Asn1Tagged     protocolOp   = (Asn1Tagged)get_Renamed(1);
            Asn1Identifier protocolOpId = protocolOp.getIdentifier();

            content = ((Asn1OctetString)protocolOp.taggedValue()).byteValue();
            bais    = new MemoryStream(SupportClass.ToByteArray(content));

            switch (protocolOpId.Tag)
            {
            case LdapMessage.SEARCH_RESPONSE:
                set_Renamed(1, new RfcSearchResultEntry(dec, bais, content.Length));
                break;

            case LdapMessage.SEARCH_RESULT:
                set_Renamed(1, new RfcSearchResultDone(dec, bais, content.Length));
                break;

            case LdapMessage.SEARCH_RESULT_REFERENCE:
                set_Renamed(1, new RfcSearchResultReference(dec, bais, content.Length));
                break;

            case LdapMessage.ADD_RESPONSE:
                set_Renamed(1, new RfcAddResponse(dec, bais, content.Length));
                break;

            case LdapMessage.BIND_RESPONSE:
                set_Renamed(1, new RfcBindResponse(dec, bais, content.Length));
                break;

            case LdapMessage.COMPARE_RESPONSE:
                set_Renamed(1, new RfcCompareResponse(dec, bais, content.Length));
                break;

            case LdapMessage.DEL_RESPONSE:
                set_Renamed(1, new RfcDelResponse(dec, bais, content.Length));
                break;

            case LdapMessage.EXTENDED_RESPONSE:
                set_Renamed(1, new RfcExtendedResponse(dec, bais, content.Length));
                break;

            case LdapMessage.INTERMEDIATE_RESPONSE:
                set_Renamed(1, new RfcIntermediateResponse(dec, bais, content.Length));
                break;

            case LdapMessage.MODIFY_RESPONSE:
                set_Renamed(1, new RfcModifyResponse(dec, bais, content.Length));
                break;

            case LdapMessage.MODIFY_RDN_RESPONSE:
                set_Renamed(1, new RfcModifyDNResponse(dec, bais, content.Length));
                break;

            default:
                throw new Exception("RfcLdapMessage: Invalid tag: " + protocolOpId.Tag);
            }

            // decode optional implicitly tagged controls from Asn1Tagged type to
            // to RFC 2251 types.
            if (size() > 2)
            {
                Asn1Tagged controls = (Asn1Tagged)get_Renamed(2);
                //   Asn1Identifier controlsId = protocolOp.getIdentifier();
                // we could check to make sure we have controls here....

                content = ((Asn1OctetString)controls.taggedValue()).byteValue();
                bais    = new MemoryStream(SupportClass.ToByteArray(content));
                set_Renamed(2, new RfcControls(dec, bais, content.Length));
            }
        }
Exemplo n.º 18
0
        protected void ProcessMessage(sbyte[] returnedValue)
        {
            LBERDecoder  decoder  = new LBERDecoder();
            Asn1Sequence sequence = (Asn1Sequence)decoder.decode(returnedValue);

            event_type        = (EdirEventType)(((Asn1Integer)sequence.get_Renamed(0)).intValue());
            event_result_type = (EdirEventResultType)(((Asn1Integer)sequence.get_Renamed(1)).intValue());

            if (sequence.size() > 2)
            {
                Asn1Tagged objTagged = (Asn1Tagged)sequence.get_Renamed(2);

                switch ((EdirEventDataType)(objTagged.getIdentifier().Tag))
                {
                case EdirEventDataType.EDIR_TAG_ENTRY_EVENT_DATA:
                    event_response_data = new EntryEventData(EdirEventDataType.EDIR_TAG_ENTRY_EVENT_DATA, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_VALUE_EVENT_DATA:
                    event_response_data = new ValueEventData(EdirEventDataType.EDIR_TAG_VALUE_EVENT_DATA, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_DEBUG_EVENT_DATA:
                    event_response_data = new DebugEventData(EdirEventDataType.EDIR_TAG_DEBUG_EVENT_DATA, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_GENERAL_EVENT_DATA:
                    event_response_data = new GeneralDSEventData(EdirEventDataType.EDIR_TAG_GENERAL_EVENT_DATA, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_SKULK_DATA:
                    event_response_data = null;
                    break;

                case EdirEventDataType.EDIR_TAG_BINDERY_EVENT_DATA:
                    event_response_data = new BinderyObjectEventData(EdirEventDataType.EDIR_TAG_BINDERY_EVENT_DATA, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_DSESEV_INFO:
                    event_response_data = new SecurityEquivalenceEventData(EdirEventDataType.EDIR_TAG_DSESEV_INFO, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_MODULE_STATE_DATA:
                    event_response_data = new ModuleStateEventData(EdirEventDataType.EDIR_TAG_MODULE_STATE_DATA, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_NETWORK_ADDRESS:
                    event_response_data = new NetworkAddressEventData(EdirEventDataType.EDIR_TAG_NETWORK_ADDRESS, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_CONNECTION_STATE:
                    event_response_data = new ConnectionStateEventData(EdirEventDataType.EDIR_TAG_CONNECTION_STATE, objTagged.taggedValue());
                    break;

                case EdirEventDataType.EDIR_TAG_CHANGE_SERVER_ADDRESS:
                    event_response_data = new ChangeAddressEventData(EdirEventDataType.EDIR_TAG_CHANGE_SERVER_ADDRESS, objTagged.taggedValue());
                    break;

                /*
                 *    case EdirEventDataType.EDIR_TAG_CHANGE_CONFIG_PARAM :
                 *        responsedata =
                 *            new ChangeConfigEventData(
                 *                taggedobject.taggedValue());
                 *
                 *        break;
                 *
                 *    case EdirEventDataType.EDIR_TAG_STATUS_LOG :
                 *        responsedata =
                 *            new StatusLogEventData(taggedobject.taggedValue());
                 *
                 *        break;
                 */
                case EdirEventDataType.EDIR_TAG_NO_DATA:
                    event_response_data = null;
                    break;

                default:
                    //unhandled data.
                    throw new IOException();
                }
            }
            else
            {
                //NO DATA
                event_response_data = null;
            }
        }
Exemplo n.º 19
0
        // *************************************************************************
        // Constructors for AuthenticationChoice
        // *************************************************************************

        /// <summary> </summary>
        public RfcAuthenticationChoice(Asn1Tagged choice)
            : base(choice)
        {
        }
Exemplo n.º 20
0
        public GeneralDSEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

            ds_time = getTaggedIntValue(
                (Asn1Tagged)decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_DSTIME);
            milli_seconds = getTaggedIntValue(
                (Asn1Tagged)decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_MILLISEC);

            nVerb = getTaggedIntValue(
                (Asn1Tagged)decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_VERB);
            current_process = getTaggedIntValue(
                (Asn1Tagged)decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_CURRPROC);

            strPerpetratorDN = getTaggedStringValue(
                (Asn1Tagged)decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_PERP);

            Asn1Tagged temptaggedvalue =
                ((Asn1Tagged)decoder.decode(decodedData, length));

            if (temptaggedvalue.getIdentifier().Tag
                == (int)GeneralEventField.EVT_TAG_GEN_INTEGERS)
            {
                //Integer List.
                Asn1Sequence inteseq   = getTaggedSequence(temptaggedvalue, GeneralEventField.EVT_TAG_GEN_INTEGERS);
                Asn1Object[] intobject = inteseq.toArray();
                integer_values = new int[intobject.Length];

                for (int i = 0; i < intobject.Length; i++)
                {
                    integer_values[i] = ((Asn1Integer)intobject[i]).intValue();
                }

                //second decoding for Strings.
                temptaggedvalue = ((Asn1Tagged)decoder.decode(decodedData, length));
            }
            else
            {
                integer_values = null;
            }

            if ((temptaggedvalue.getIdentifier().Tag
                 == (int)GeneralEventField.EVT_TAG_GEN_STRINGS) &&
                (temptaggedvalue.getIdentifier().Constructed))
            {
                //String values.
                Asn1Sequence inteseq =
                    getTaggedSequence(temptaggedvalue, GeneralEventField.EVT_TAG_GEN_STRINGS);
                Asn1Object[] stringobject = inteseq.toArray();
                string_values = new string[stringobject.Length];

                for (int i = 0; i < stringobject.Length; i++)
                {
                    string_values[i] =
                        ((Asn1OctetString)stringobject[i]).stringValue();
                }
            }
            else
            {
                string_values = null;
            }

            DataInitDone();
        }