Example #1
0
        internal static void Decode(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory <byte> rebind, out FieldID decoded)
        {
            decoded = default;
            AsnValueReader      sequenceReader = reader.ReadSequence(expectedTag);
            ReadOnlySpan <byte> rebindSpan     = rebind.Span;
            int offset;
            ReadOnlySpan <byte> tmpSpan;

            decoded.FieldType  = sequenceReader.ReadObjectIdentifierAsString();
            tmpSpan            = sequenceReader.ReadEncodedValue();
            decoded.Parameters = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray();

            sequenceReader.ThrowIfNotEmpty();
        }
Example #2
0
 internal static void Decode(ref AsnValueReader reader, ReadOnlyMemory <byte> rebind, out FieldID decoded)
 {
     Decode(ref reader, Asn1Tag.Sequence, rebind, out decoded);
 }