Initializer
Decoder(Tag? tag)
Parameters:
  • tag

    The (IMPLICIT) tag that must be present in the encoding, or null if any tag should be accepted.

Attributes
tagshared Tag? tag

The (IMPLICIT) tag that must be present in the encoding, or null if any tag should be accepted.

Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
decodeshared [Asn1Type, Integer]|DecodingError decode(Byte[] input, Integer offset = 0)

Decodes an ASN.1 value, returning the value and the offset of the next ASN.1 value in input.

This method decodes the identity octets, then delegates to decodeGivenTag().

Parameters:
  • input

    The input to decode. Must be encoded according to the BER.

  • offset = 0

    The offset in input of the start of the ASN.1 value to decode—the first (or only) identity octet.

decodeGivenTagshared [Asn1Type, Integer]|DecodingError decodeGivenTag(Byte[] input, Integer offset, IdentityInfo identityInfo, Integer identityOctetsOffset, Boolean violatesDer)

Decodes the length and contents octets of an ASN.1 value, after the identity octets already have been decoded.

This method decodes the length octets, then delegates to decodeGivenTagAndLength().

Parameters:
  • input

    The input to decode. Must be encoded according to the BER (without identity octets).

  • offset

    The offset in input of the start of the length octets of the ASN.1 value to decode.

  • identityInfo

    The already decoded identity octets of the ASN.1 value to decode.

  • identityOctetsOffset

    The offset in input of the start of the ASN.1 value to decode—the first (or only) identity octet.

  • violatesDer

    Indicates if the decoding of the identity octets of the ASN.1 value to decode violated the DER.

decodeGivenTagAndLengthshared formal [Asn1Type, Integer]|DecodingError decodeGivenTagAndLength(Byte[] input, Integer offset, IdentityInfo identityInfo, Integer length, Integer identityOctetsOffset, Integer lengthOctetsOffset, Boolean violatesDer)

Decodes the contents octets part of the encoded value. Implementations must ensure that they use all contents bits and return a DecodingError if not. A DecodingError must also be returned if the input is shorter than indicated by length.

Parameters:
  • input

    The input to decode. Must be encoded according to the BER.

  • offset

    The offset in input of the first (or only) contents octet. If there are no contents octets (like in NULL), this is the offset of the first byte after the ASN.1 value.

  • identityInfo

    The already decoded identity octets of the ASN.1 value to decode.

  • length

    The already decoded length octets of the ASN.1 value to decode.

  • identityOctetsOffset

    The offset in input of the start of this ASN.1 value. Must lie before offset.

  • lengthOctetsOffset

    The offset in input of the first (or only) length octet. Must lie before offset and after identityOctetsOffset.

  • violatesDer

    Indicates if the decoding of the identity and length octets of the ASN.1 value to decode violated the DER.

tagMatchshared Boolean tagMatch(Tag otherTag)

Checks if the passed in otherTag matches the tag in this decoder. That means it returns true also if this is a “matches any tag” decoder.

Inherited Methods
Methods inherited from: Object
equals