internal bool Equals(ref AlgorithmIdentifierAsn other) { if (Algorithm != other.Algorithm) { return(false); } bool isNull = RepresentsNull(Parameters); bool isOtherNull = RepresentsNull(other.Parameters); if (isNull != isOtherNull) { return(false); } if (isNull) { return(true); } return(Parameters !.Value.Span.SequenceEqual(other.Parameters !.Value.Span)); }
public static void Decode(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory <byte> rebind, out AlgorithmIdentifierAsn decoded) { decoded = default; AsnValueReader sequenceReader = reader.ReadSequence(expectedTag); ReadOnlySpan <byte> rebindSpan = rebind.Span; int offset; ReadOnlySpan <byte> tmpSpan; decoded.Algorithm = sequenceReader.ReadObjectIdentifier(); if (sequenceReader.HasData) { tmpSpan = sequenceReader.ReadEncodedValue(); decoded.Parameters = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray(); } sequenceReader.ThrowIfNotEmpty(); }
public static void Decode(ref AsnValueReader reader, ReadOnlyMemory <byte> rebind, out AlgorithmIdentifierAsn decoded) { Decode(ref reader, Asn1Tag.Sequence, rebind, out decoded); }