ASN1ApplicationSpecific (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.asn1

## Class ASN1ApplicationSpecific

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.ASN1Primitive
    - - org.bouncycastle.asn1.ASN1ApplicationSpecific

- All Implemented Interfaces:
    ASN1Encodable, Encodable
  Direct Known Subclasses:
    BERApplicationSpecific, DERApplicationSpecific

      public abstract class ASN1ApplicationSpecific
      extends ASN1Primitive

  Base class for an application specific object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `isConstructed`
    `protected byte[]` | `octets`
    `protected int` | `tag`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getApplicationTag()` Return the tag number associated with this object,
    `byte[]` | `getContents()` Return the contents of this object as a byte[]
    `static ASN1ApplicationSpecific` | `getInstance(java.lang.Object obj)` Return an ASN1ApplicationSpecific from the passed in object, which may be a byte array, or null.
    `protected static int` | `getLengthOfHeader(byte[] data)`
    `ASN1Primitive` | `getObject()` Return the enclosed object assuming explicit tagging.
    `ASN1Primitive` | `getObject(int derTagNo)` Return the enclosed object assuming implicit tagging.
    `int` | `hashCode()`
    `boolean` | `isConstructed()` Return true if the object is marked as constructed, false otherwise.

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

      `equals, fromByteArray, toASN1Primitive`

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

      `getEncoded, getEncoded, hasEncodedTagValue, toASN1Object`

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

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

- - ### Field Detail

    - #### isConstructed

          protected final boolean isConstructed

    - #### tag

          protected final int tag

    - #### octets

          protected final byte[] octets

  - ### Method Detail

    - #### getInstance

          public static ASN1ApplicationSpecific getInstance(java.lang.Object obj)

      Return an ASN1ApplicationSpecific from the passed in object, which may be a byte array, or null.
      Parameters:
        `obj` - the object to be converted.
      Returns:
        obj's representation as an ASN1ApplicationSpecific object.

    - #### getLengthOfHeader

          protected static int getLengthOfHeader(byte[] data)

    - #### isConstructed

          public boolean isConstructed()

      Return true if the object is marked as constructed, false otherwise.
      Returns:
        true if constructed, otherwise false.

    - #### getContents

          public byte[] getContents()

      Return the contents of this object as a byte[]
      Returns:
        the encoded contents of the object.

    - #### getApplicationTag

          public int getApplicationTag()

      Return the tag number associated with this object,
      Returns:
        the application tag number.

    - #### getObject

          public ASN1Primitive getObject()
                                  throws java.io.IOException

      Return the enclosed object assuming explicit tagging.
      Returns:
        the resulting object
      Throws:
        `java.io.IOException` - if reconstruction fails.

    - #### getObject

          public ASN1Primitive getObject(int derTagNo)
                                  throws java.io.IOException

      Return the enclosed object assuming implicit tagging.
      Parameters:
        `derTagNo` - the type tag that should be applied to the object's contents.
      Returns:
        the resulting object
      Throws:
        `java.io.IOException` - if reconstruction fails.

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `ASN1Primitive`