Esempio n. 1
0
        internal static void Decode(AsnReader reader, Asn1Tag expectedTag, out X501AttributeAsn decoded)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            decoded = default;
            AsnReader sequenceReader = reader.ReadSequence(expectedTag);
            AsnReader collectionReader;

            decoded.AttrId = sequenceReader.ReadObjectIdentifier();

            // Decode SEQUENCE OF for AttrValues
            {
                collectionReader = sequenceReader.ReadSetOf();
                var tmpList = new List <ReadOnlyMemory <byte> >();
                ReadOnlyMemory <byte> tmpItem;

                while (collectionReader.HasData)
                {
                    tmpItem = collectionReader.GetEncodedValue();
                    tmpList.Add(tmpItem);
                }

                decoded.AttrValues = tmpList.ToArray();
            }


            sequenceReader.ThrowIfNotEmpty();
        }
Esempio n. 2
0
        internal static void Decode(AsnReader reader, out X501AttributeAsn decoded)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            Decode(reader, Asn1Tag.Sequence, out decoded);
        }