DERExternalParser (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.asn1

## Class DERExternalParser

- java.lang.Object
- - org.bouncycastle.asn1.DERExternalParser

- All Implemented Interfaces:
    ASN1Encodable, ASN1ExternalParser, InMemoryRepresentable

      public class DERExternalParser
      extends java.lang.Object
      implements ASN1ExternalParser

  Parser DER EXTERNAL tagged objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DERExternalParser(ASN1StreamParser parser)` Base constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ASN1Primitive` | `getLoadedObject()` Return an in-memory, encodable, representation of the EXTERNAL object.
    `ASN1Encodable` | `readObject()` Read the next object in the parser.
    `ASN1Primitive` | `toASN1Primitive()` Return an DERExternal representing this parser and its contents.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### DERExternalParser

          public DERExternalParser(ASN1StreamParser parser)

      Base constructor.
      Parameters:
        `parser` - the underlying parser to read the DER EXTERNAL from.

  - ### Method Detail

    - #### readObject

          public ASN1Encodable readObject()
                                   throws java.io.IOException

      Description copied from interface: `ASN1ExternalParser`
      Read the next object in the parser.
      Specified by:
        `readObject` in interface `ASN1ExternalParser`
      Returns:
        an ASN1Encodable
      Throws:
        `java.io.IOException` - on a parsing or decoding error.

    - #### getLoadedObject

          public ASN1Primitive getLoadedObject()
                                        throws java.io.IOException

      Return an in-memory, encodable, representation of the EXTERNAL object.
      Specified by:
        `getLoadedObject` in interface `InMemoryRepresentable`
      Returns:
        a DERExternal.
      Throws:
        `java.io.IOException` - if there is an issue loading the data.

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

      Return an DERExternal representing this parser and its contents.
      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Returns:
        an DERExternal