org.bouncycastle.asn1

## Class DERSequence

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

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

      public class DERSequence
      extends ASN1Sequence

  Definite length SEQUENCE, encoding tells explicit number of bytes that the content of this sequence occupies.

  For X.690 syntax rules, see `ASN1Sequence`.

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DERSequence()` Create an empty sequence.
    `DERSequence(ASN1Encodable element)` Create a sequence containing one object.
    `DERSequence(ASN1Encodable[] elements)` Create a sequence containing an array of objects.
    `DERSequence(ASN1Encodable element1, ASN1Encodable element2)` Create a sequence containing two objects.
    `DERSequence(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 DERSequence` | `convert(ASN1Sequence seq)`
    `static DERSequence` | `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, 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 DERSequence EMPTY

  - ### Constructor Detail

    - #### DERSequence

          public DERSequence()

      Create an empty sequence.

    - #### DERSequence

          public DERSequence(ASN1Encodable element)

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

    - #### DERSequence

          public DERSequence(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.

    - #### DERSequence

          public DERSequence(ASN1EncodableVector elementVector)

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

    - #### DERSequence

          public DERSequence(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 DERSequence convert(ASN1Sequence seq)

    - #### fromElementsOptional

          public static DERSequence fromElementsOptional(ASN1Encodable[] elements)