Package 

Class Asn1Decoder


  • 
    public final class Asn1Decoder
    
                        

    This represents a decoder helping decode an array of bytes or a hex string into Asn1Nodes. This class tracks the next position for decoding. This class is not thread-safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      Asn1Decoder(String hex) Creates a decoder on a hex string.
      Asn1Decoder(Array<byte> src) Creates a decoder on a byte array.
      Asn1Decoder(Array<byte> bytes, int offset, int length) Creates a decoder on a byte array slice.
    • Method Summary

      Modifier and Type Method Description
      int getPosition()
      boolean hasNextNode() Returns whether the node has a next node.
      Asn1Node nextNode() Parses the next node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Asn1Decoder

        Asn1Decoder(String hex)
        Creates a decoder on a hex string.
      • Asn1Decoder

        Asn1Decoder(Array<byte> src)
        Creates a decoder on a byte array.
      • Asn1Decoder

        Asn1Decoder(Array<byte> bytes, int offset, int length)
        Creates a decoder on a byte array slice.
    • Method Detail

      • hasNextNode

         boolean hasNextNode()

        Returns whether the node has a next node.

      • nextNode

         Asn1Node nextNode()

        Parses the next node. If the node is a constructed node, its children will be parsed onlywhen they are accessed, e.g., though getChildren.