java.lang.Object
software.amazon.awssdk.services.cloudfront.internal.auth.Asn1Object

public class Asn1Object extends Object
  • Constructor Details

    • Asn1Object

      public Asn1Object(int tag, int length, byte[] value)
      Construct a ASN.1 TLV. The TLV could be either a constructed or primitive entity.

      The first byte in DER encoding is made of following fields,

      -------------------------------------------------
      |Bit 8|Bit 7|Bit 6|Bit 5|Bit 4|Bit 3|Bit 2|Bit 1|
      -------------------------------------------------
      |  Class    | CF  |     +      Type             |
      -------------------------------------------------
       
      • Class: Universal, Application, Context or Private
      • CF: Constructed flag. If 1, the field is constructed.
      • Type: This is actually called tag in ASN.1. It indicates data type (Integer, String) or a construct (sequence, choice, set).
      Parameters:
      tag - Tag or Identifier
      length - Length of the field
      value - Encoded octet string for the field.
  • Method Details

    • getType

      public int getType()
    • getLength

      public int getLength()
    • getValue

      public byte[] getValue()
    • isConstructed

      public boolean isConstructed()
    • getParser

      public DerParser getParser() throws IOException
      For constructed field, return a parser for its content.
      Returns:
      A parser for the construct.
      Throws:
      IOException
    • getInteger

      public BigInteger getInteger() throws IOException
      Get the value as integer
      Throws:
      IOException
    • getString

      public String getString() throws IOException
      Get value as string. Most strings are treated as Latin-1.
      Throws:
      IOException