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

org.bouncycastle.asn1

## Class DLSequence

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.ASN1Primitive
    - - org.bouncycastle.asn1.ASN1Sequence
      - - org.bouncycastle.asn1.DLSequence

- All Implemented Interfaces:
    java.lang.Iterable<ASN1Encodable>, ASN1Encodable, Encodable

      public class DLSequence
      extends ASN1Sequence

  The DLSequence encodes a SEQUENCE using definite length form.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static DLSequence` | `EMPTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DLSequence()` Create an empty sequence.
    `DLSequence(ASN1Encodable element)` Create a sequence containing one object.
    `DLSequence(ASN1Encodable[] elements)` create a sequence containing an array of objects.
    `DLSequence(ASN1Encodable element1, ASN1Encodable element2)` Create a sequence containing two objects.
    `DLSequence(ASN1EncodableVector elementVector)` create a sequence containing a vector of objects.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DLSequence` | `convert(ASN1Sequence seq)`
    `static DLSequence` | `fromElementsOptional(ASN1Encodable[] elements)`

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

      `getInstance, getInstance, getObjectAt, getObjects, getTagged, hashCode, iterator, parser, size, toArray, toString`

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

      `encodeTo, encodeTo, equals, equals, equals, fromByteArray, fromStream, toASN1Primitive`

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

      `getEncoded, getEncoded, hasEncodedTagValue`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### EMPTY

          public static final DLSequence EMPTY

  - ### Constructor Detail

    - #### DLSequence

          public DLSequence()

      Create an empty sequence.

    - #### DLSequence

          public DLSequence(ASN1Encodable element)

      Create a sequence containing one object.
      Parameters:
        `element` - the object to go in the sequence.

    - #### DLSequence

          public DLSequence(ASN1Encodable element1,
                            ASN1Encodable element2)

      Create a sequence containing two objects.
      Parameters:
        `element1` - the first object to go in the sequence.
        `element2` - the second object to go in the sequence.

    - #### DLSequence

          public DLSequence(ASN1EncodableVector elementVector)

      create a sequence containing a vector of objects.
      Parameters:
        `elementVector` - the vector of objects to make up the sequence.

    - #### DLSequence

          public DLSequence(ASN1Encodable[] elements)

      create a sequence containing an array of objects.
      Parameters:
        `elements` - the array of objects to make up the sequence.

  - ### Method Detail

    - #### convert

          public static DLSequence convert(ASN1Sequence seq)

    - #### fromElementsOptional

          public static DLSequence fromElementsOptional(ASN1Encodable[] elements)