Class ASN1Explicit

All Implemented Interfaces:
ASN1Constants

public final class ASN1Explicit
extends ASN1Constructed
This class represents explicitly tagged ASN.1 type.
See Also:
ASN.1
  • Field Details

    • type

      public final ASN1Type type
      Tagged type
  • Constructor Details

    • ASN1Explicit

      public ASN1Explicit​(int tagNumber, ASN1Type type)
      Constructs explicitly tagged ASN.1 type with context-specific tag class and specified tag number.
      Parameters:
      tagNumber - - ASN.1 tag number
      type - - ASN.1 type to be tagged
      Throws:
      IllegalArgumentException - - if tagNumber is invalid
    • ASN1Explicit

      public ASN1Explicit​(int tagClass, int tagNumber, ASN1Type type)
      Constructs explicitly tagged ASN.1 type.
      Parameters:
      tagClass - - ASN.1 tag class.
      tagNumber - - ASN.1 tag number
      type - - ASN.1 type to be tagged
      Throws:
      IllegalArgumentException - - if tagClass or tagNumber is invalid
  • Method Details

    • decode

      public Object decode​(BerInputStream in) throws IOException
      Description copied from class: ASN1Type
      Decodes ASN.1 type.
      Specified by:
      decode in class ASN1Type
      Throws:
      IOException - if an I/O error occurs or the end of the stream is reached
    • encodeContent

      public void encodeContent​(BerOutputStream out)
      Specified by:
      encodeContent in class ASN1Type
    • setEncodingContent

      public void setEncodingContent​(BerOutputStream out)
      Specified by:
      setEncodingContent in class ASN1Type
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
         getClass().getName() + '@' + Integer.toHexString(hashCode())

      See Writing a useful toString method if you intend implementing your own toString method.

      Overrides:
      toString in class ASN1Type
      Returns:
      a printable representation of this object.