Class GPTLV_Generic

  • Direct Known Subclasses:
    GPTLV_EMV

    public abstract class GPTLV_Generic
    extends java.lang.Object
    Abstract base class for EMV, DGI and L16 encoded TLV objects
    Author:
    Andreas Schwier (www.cardcontact.de)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected byte[] data
      Data block of the TLV object
      static int INVALID_SIZE  
      protected int tag
      Tag of the TLV object
    • Constructor Summary

      Constructors 
      Constructor Description
      GPTLV_Generic​(int tag, byte[] data)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract byte[] encodeLength()
      Encode length field in byte array
      abstract byte[] encodeTag()
      Encode tag field in byte array
      byte[] getL()
      Return the encoded length field of the TLV object
      abstract int getLengthFieldSizeHelper()
      Helper function for getSize() and getLengthFieldSize()
      byte[] getLV()
      Return the encoded length and value field of the TLV object
      int getTag()
      Return the tag of the TLV object
      abstract int getTagFieldSizeHelper()
      Helper function to determine bytes required to store the tag
      byte[] getTLV()
      Return the encoded TLV structure of the object
      byte[] getTV()
      Return the encoded tag and length field of the TLV object
      byte[] getValue()
      Return the value field of the TLV object
      • Methods inherited from class java.lang.Object

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

      • tag

        protected int tag
        Tag of the TLV object
      • data

        protected byte[] data
        Data block of the TLV object
    • Constructor Detail

      • GPTLV_Generic

        public GPTLV_Generic​(int tag,
                             byte[] data)
    • Method Detail

      • getL

        public byte[] getL()
        Return the encoded length field of the TLV object
        Returns:
        Encoded length field
      • getLV

        public byte[] getLV()
        Return the encoded length and value field of the TLV object
        Returns:
        Encoded length and value field
      • getTag

        public int getTag()
        Return the tag of the TLV object
        Returns:
        Tag
      • getTLV

        public byte[] getTLV()
        Return the encoded TLV structure of the object
        Returns:
        TLV structure
      • getTV

        public byte[] getTV()
        Return the encoded tag and length field of the TLV object
        Returns:
        Encoded tag and length field
      • getValue

        public byte[] getValue()
        Return the value field of the TLV object
        Returns:
        Value field
      • getTagFieldSizeHelper

        public abstract int getTagFieldSizeHelper()
        Helper function to determine bytes required to store the tag
        Returns:
        Number of bytes required to store tag
      • encodeTag

        public abstract byte[] encodeTag()
        Encode tag field in byte array
        Returns:
      • getLengthFieldSizeHelper

        public abstract int getLengthFieldSizeHelper()
        Helper function for getSize() and getLengthFieldSize()
        Returns:
        Size of length field in bytes
      • encodeLength

        public abstract byte[] encodeLength()
        Encode length field in byte array
        Returns:
        Encoded length field