public static AsnRelativeDistinguishedName Decode(byte[] source, ref int pos)
        {
            AsnRelativeDistinguishedName instance = new AsnRelativeDistinguishedName();

            // skip the 0x31 (SET)
            pos++;

            long length = instance.GetLength(source, ref pos);

            long start = pos;

            // each entry in the set is comprised of an attribute type and value pair
            while (pos < start + length)
            {
                AsnAttributeTypeAndValue tv = AsnAttributeTypeAndValue.Decode(source, ref pos);
                instance.elements.Add(tv);
            }

            return(instance);
        }
Example #2
0
        public static AsnName Decode(byte[] source, ref int pos)
        {
            AsnName instance = new AsnName();

            //CheckContextTag(source, ref pos);

            // skip the 0x30 (SEQUENCE)
            pos++;

            // sequence length
            long length = instance.GetLength(source, ref pos);

            // now we should see a set and length of the set
            long start = pos;

            // decode the set
            while (pos < start + length)
            {
                AsnRelativeDistinguishedName name = AsnRelativeDistinguishedName.Decode(source, ref pos);
                instance.elements.Add(name);
            }

            return(instance);
        }