Class OctetStringValue

java.lang.Object
net.aifusion.asn.AsnValue
net.aifusion.asn.OctetStringValue

public class OctetStringValue extends AsnValue
Class to wrap an ASN.1 Octet String
Author:
Sharad Singhal
  • Constructor Details

    • OctetStringValue

      public OctetStringValue(byte[] value)
      Create an ASN.1 Octet String
      Parameters:
      value - - byte [] containing the octets
  • Method Details

    • create

      public static OctetStringValue create(byte[] buffer, int blen, int cursor)
      Create an OctetString value
      Parameters:
      buffer - - input buffer containing serialized value
      blen - - length of input buffer
      cursor - - current cursor
      Returns:
      - OctetStringValue
    • getEncodedValue

      public byte[] getEncodedValue()
      Description copied from class: AsnValue
      Get the encoded value for this ASN.1 value. This method should be implemented by subclasses to provide the encoded ASN.1 value
      Specified by:
      getEncodedValue in class AsnValue
      Returns:
      byte [] containing encoded value for this ASN.1 value (including tag, length, content)
    • getValue

      public byte[] getValue()
    • toAsnString

      public String toAsnString(String prefix)
      Description copied from class: AsnValue
      Get a (semi) ASN.1 notation for this value.
      Overrides:
      toAsnString in class AsnValue
      Parameters:
      prefix - - prefix to add to each line
      Returns:
      - string containing the ASN.1 value
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object