Asn1Parser (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.tomcat.util.buf, class: Asn1Parser

# Class Asn1Parser

java.lang.Object
org.apache.tomcat.util.buf.Asn1Parser

public class Asn1Parser extends Object
This is a very basic ASN.1 parser that provides the limited functionality required by Tomcat. It is a long way from a complete parser.

TODO: Consider extending/re-writing this parser and refactoring the SpnegoTokenFixer to use it.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `TAG_ATTRIBUTE_BASE`
  `static final int`
  `TAG_INTEGER`
  `static final int`
  `TAG_NULL`
  `static final int`
  `TAG_OCTET_STRING`
  `static final int`
  `TAG_OID`
  `static final int`
  `TAG_SEQUENCE`
  `static final int`
  `TAG_UTF8STRING`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Asn1Parser(byte[] source)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `eof()`
  `int`
  `getNestedSequenceLevel()`
  `byte[]`
  `parseAttributeAsBytes(int index)`
  `void`
  `parseBytes(byte[] dest)`
  `void`
  `parseFullLength()`
  `BigInteger`
  `parseInt()`
  `int`
  `parseLength()`
  `void`
  `parseNull()`
  `byte[]`
  `parseOctetString()`
  `byte[]`
  `parseOIDAsBytes()`
  `void`
  `parseTag(int tag)`
  `void`
  `parseTagSequence()`
  `String`
  `parseUTF8String()`
  `int`
  `peekTag()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TAG_INTEGER

    public static final int TAG_INTEGER
    See Also:
      - Constant Field Values

  - ### TAG_OCTET_STRING

    public static final int TAG_OCTET_STRING
    See Also:
      - Constant Field Values

  - ### TAG_NULL

    public static final int TAG_NULL
    See Also:
      - Constant Field Values

  - ### TAG_OID

    public static final int TAG_OID
    See Also:
      - Constant Field Values

  - ### TAG_UTF8STRING

    public static final int TAG_UTF8STRING
    See Also:
      - Constant Field Values

  - ### TAG_SEQUENCE

    public static final int TAG_SEQUENCE
    See Also:
      - Constant Field Values

  - ### TAG_ATTRIBUTE_BASE

    public static final int TAG_ATTRIBUTE_BASE
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Asn1Parser

    public Asn1Parser(byte[] source)

- ## Method Details

  - ### eof

    public boolean eof()

  - ### peekTag

    public int peekTag()

  - ### parseTagSequence

    public void parseTagSequence()

  - ### parseTag

    public void parseTag(int tag)

  - ### parseFullLength

    public void parseFullLength()

  - ### parseLength

    public int parseLength()

  - ### parseInt

    public BigInteger parseInt()

  - ### parseOctetString

    public byte[] parseOctetString()

  - ### parseNull

    public void parseNull()

  - ### parseOIDAsBytes

    public byte[] parseOIDAsBytes()

  - ### parseUTF8String

    public String parseUTF8String()

  - ### parseAttributeAsBytes

    public byte[] parseAttributeAsBytes(int index)

  - ### parseBytes

    public void parseBytes(byte[] dest)

  - ### getNestedSequenceLevel

    public int getNestedSequenceLevel()