Interface BERTLVFileView

  • All Superinterfaces:
    FileView, javacard.framework.Shareable
    All Known Subinterfaces:
    AdminBERTLVFileView

    public interface BERTLVFileView
    extends FileView
    The BERTLVFileView interface defines the methods to access BER TLV files.
    All the methods are based on the commands of the TS 102 221 specification.
    • Method Detail

      • retrieveData

        int retrieveData​(int tag,
                         int dataObjectOffset,
                         byte[] responseBuffer,
                         short responseOffset,
                         short responseLength)
        This method retrieves a part of a data object from the current BER-TLV structure EF.

        Notes:

        • The TAG and Length of the requested data object are not copied in responseBuffer
        • After a successful call to this method, current TAG pointer and current offset in the data object are undefined
        • If responseOffset or responseLength parameter is negative an ArrayIndexOutOfBoundsException exception is thrown.
        • If responseOffset+responseLength is greater than responseBuffer.length, the length of the responseBuffer array a ArrayIndexOutOfBoundsException exception is thrown and no read is performed.
        • If tag value is invalid or is equal to '5C', an UICCException with reason code INVALID_TAG_VALUE is thrown
        Parameters:
        tag - is the TAG value of TLV object that shall be retrieved.
        dataObjectOffset - is the offset in the data object.
        responseBuffer - is the reference to the response byte array for read data.
        responseOffset - is the offset in the response byte array.
        responseLength - is the number of bytes to read.
        Returns:
        Number of remaining bytes to read
        Throws:
        java.lang.NullPointerException - if responseBuffer is null
        java.lang.ArrayIndexOutOfBoundsException - if reading would cause access of data outside array bounds
        UICCException - in case of error
        • INTERNAL_ERROR
        • COMMAND_INCOMPATIBLE
        • SECURITY_STATUS_NOT_SATISFIED
        • REF_DATA_INVALIDATED
        • NO_EF_SELECTED
        • REFERENCED_DATA_NOT_FOUND
        • CONDITIONS_OF_USE_NOT_SATISFIED
        • OUT_OF_DATA_BOUNDARIES
        • INVALID_TAG_VALUE
      • getTAGList

        int getTAGList​(byte mode,
                       int[] responseBuffer,
                       short responseOffset,
                       short responseLength)
        This method gets the list of TAGs already allocated in the current BER-TLV structure EF.

        Notes:

        • After a successful call to this method, current TAG pointer and current offset in the data object are undefined
        • If responseOffset or responseLength parameter is negative an ArrayIndexOutOfBoundsException exception is thrown.
        • If responseOffset+responseLength is greater than responseBuffer.length, the length of the responseBuffer array a ArrayIndexOutOfBoundsException exception is thrown and no operation is performed.
        Parameters:
        mode - is the mode to be used (UICCConstants.BER_TLV_ACC_MODE_FIRST or UICCConstants.BER_TLV_ACC_MODE_NEXT)
        responseBuffer - is the reference to the response int array for read data. Each component of the responseBufferarray contains a single TAG.
        responseOffset - is the offset in the response int array.
        responseLength - is the number of TAGs to read.
        Returns:
        Number of remaining TAGs to read
        Throws:
        java.lang.NullPointerException - if responseBuffer is null
        java.lang.ArrayIndexOutOfBoundsException - if reading would cause access of data outside array bounds
        UICCException - in case of error
        • INTERNAL_ERROR
        • COMMAND_INCOMPATIBLE
        • SECURITY_STATUS_NOT_SATISFIED
        • REF_DATA_INVALIDATED
        • NO_EF_SELECTED
        • INVALID_MODE
        • CONDITIONS_OF_USE_NOT_SATISFIED
        • OUT_OF_DATA_BOUNDARIES
      • setData

        int setData​(int tag,
                    byte mode,
                    int valueFieldLength,
                    byte[] data,
                    short offset,
                    short length)
        This method sets a data object in the current BER-TLV structure EF.

        Notes:

        • A transfer ends immediately after the end of the data object is reached (last successful call to this method).
        • As long as the transfer is not complete, the data object is not available for other entities.
        • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown.
        • If offset+length is greater than data.length, the length of the data array a ArrayIndexOutOfBoundsException exception is thrown and no update is performed.
        • If mode is BER_TLV_ACC_MODE_FIRST and length is greater than valueFieldLength, an UICCException exception with reason code OUT_OF_DATA_BOUNDARIES is thrown and no object is created.
        • If mode is BER_TLV_ACC_MODE_NEXT and the cumulative sum of length is greater than valueFieldLength provided in the call to this method with BER_TLV_ACC_MODE_FIRST, an UICCException exception with reason code OUT_OF_DATA_BOUNDARIES is thrown.
        • It is implementation dependant to throw UICCException exception with reason code OUT_OF_DATA_BOUNDARIES or ArrayIndexOutOfBoundsException, if conditions are met to thrown both exceptions.
        • If mode is BER_TLV_ACC_MODE_FIRST and valueFieldLength is equal to 0, a zero length object is created.
        • If tag value is invalid or is equal to '5C', an UICCException with reason code INVALID_TAG_VALUE is thrown
        Parameters:
        tag - is the TAG value of TLV object that shall be set. The value is not significant if mode parameter is set to UICCConstants.BER_TLV_ACC_MODE_NEXT.
        mode - is the mode to be used (UICCConstants.BER_TLV_ACC_MODE_FIRST or UICCConstants.BER_TLV_ACC_MODE_NEXT)
        valueFieldLength - is the length of the value field of the BER-TLV data object. The value is not significant if mode parameter is set to UICCConstants.BER_TLV_ACC_MODE_NEXT.
        data - is the reference to the data byte array.
        offset - is the offset in the data byte array.
        length - is the number of bytes to set.
        Returns:
        Number of remaining bytes to set
        Throws:
        java.lang.NullPointerException - if responseBuffer is null
        java.lang.ArrayIndexOutOfBoundsException - if reading would cause access of data outside array bounds
        UICCException - in case of error
        • INTERNAL_ERROR
        • COMMAND_INCOMPATIBLE
        • SECURITY_STATUS_NOT_SATISFIED
        • NO_EF_SELECTED
        • INVALID_MODE
        • MEMORY_PROBLEM
        • REFERENCED_DATA_NOT_FOUND
        • NOT_ENOUGH_MEMORY_SPACE
        • CONDITIONS_OF_USE_NOT_SATISFIED
        • OUT_OF_DATA_BOUNDARIES
        • INVALID_TAG_VALUE
      • deleteData

        void deleteData​(int tag)
        This method deletes a data object in the current BER-TLV structure EF.

        Notes:

        • After a successful call to this method, current TAG pointer and current offset in the data object are undefined
        • If tag value is invalid or is equal to '5C', an UICCException with reason code INVALID_TAG_VALUE is thrown
        Parameters:
        tag - is the TAG value of TLV object that shall be deleted.
        Throws:
        UICCException - in case of error
        • INTERNAL_ERROR
        • COMMAND_INCOMPATIBLE
        • SECURITY_STATUS_NOT_SATISFIED
        • REFERENCED_DATA_NOT_FOUND
        • CONDITIONS_OF_USE_NOT_SATISFIED
        • NO_EF_SELECTED
        • INVALID_TAG_VALUE