internal string ReadObjectIdentifier(Asn1Tag?expectedTag = default) { string ret = AsnDecoder.ReadObjectIdentifier(_span, _ruleSet, out int consumed, expectedTag); _span = _span.Slice(consumed); return(ret); }
/// <summary> /// Reads the next value as an OBJECT IDENTIFIER with a specified tag, returning /// the value in a dotted decimal format string. /// </summary> /// <param name="expectedTag"> /// The tag to check for before reading, or <see langword="null"/> for the default tag (Universal 6). /// </param> /// <exception cref="AsnContentException"> /// the next value does not have the correct tag. /// /// -or- /// /// the length encoding is not valid under the current encoding rules. /// /// -or- /// /// the contents are not valid under the current encoding rules. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="expectedTag"/>.<see cref="Asn1Tag.TagClass"/> is /// <see cref="TagClass.Universal"/>, but /// <paramref name="expectedTag"/>.<see cref="Asn1Tag.TagValue"/> is not correct for /// the method. /// </exception> public string ReadObjectIdentifier(Asn1Tag?expectedTag = null) { string oidValue = AsnDecoder.ReadObjectIdentifier(_data.Span, RuleSet, out int consumed, expectedTag); _data = _data.Slice(consumed); return(oidValue); }