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

org.bouncycastle.asn1

## Class ASN1EncodableVector

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

-     public class ASN1EncodableVector
      extends java.lang.Object

  Mutable class for building ASN.1 constructed objects such as SETs or SEQUENCEs.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ASN1EncodableVector()`
    `ASN1EncodableVector(int initialCapacity)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(ASN1Encodable element)`
    `void` | `addAll(ASN1Encodable[] others)`
    `void` | `addAll(ASN1EncodableVector other)`
    `void` | `addOptional(ASN1Encodable element)`
    `ASN1Encodable` | `get(int i)` Return the object at position i in this vector.
    `int` | `size()` Return the size of the vector.

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

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

- - ### Constructor Detail

    - #### ASN1EncodableVector

          public ASN1EncodableVector()

    - #### ASN1EncodableVector

          public ASN1EncodableVector(int initialCapacity)

  - ### Method Detail

    - #### add

          public void add(ASN1Encodable element)

    - #### addOptional

          public void addOptional(ASN1Encodable element)

    - #### addAll

          public void addAll(ASN1Encodable[] others)

    - #### addAll

          public void addAll(ASN1EncodableVector other)

    - #### get

          public ASN1Encodable get(int i)

      Return the object at position i in this vector.
      Parameters:
        `i` - the index of the object of interest.
      Returns:
        the object at position i.

    - #### size

          public int size()

      Return the size of the vector.
      Returns:
        the object count in the vector.