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

org.bouncycastle.asn1

## Class DERGenerator

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Generator
  - - org.bouncycastle.asn1.DERGenerator

- Direct Known Subclasses:
    DERSequenceGenerator

      public abstract class DERGenerator
      extends ASN1Generator

  Basic class for streaming DER encoding generators.

- - ### Field Summary

    - ### Fields inherited from class org.bouncycastle.asn1.ASN1Generator

      `_out`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DERGenerator(java.io.OutputStream out)`
    `` | `DERGenerator(java.io.OutputStream out, int tagNo, boolean isExplicit)` Create a DER encoding generator for a tagged object.

  - ### Method Summary

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Generator

      `getRawOutputStream`

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

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

- - ### Constructor Detail

    - #### DERGenerator

          protected DERGenerator(java.io.OutputStream out)

    - #### DERGenerator

          public DERGenerator(java.io.OutputStream out,
                              int tagNo,
                              boolean isExplicit)

      Create a DER encoding generator for a tagged object.
      Parameters:
        `out` - the output stream to encode objects to.
        `tagNo` - the tag number to head the output stream with.
        `isExplicit` - true if the tagging should be explicit, false otherwise.