Package uicc.access.bertlvfile
Interface BERTLVFileView
- All Superinterfaces:
FileView,javacard.framework.Shareable
- All Known Subinterfaces:
AdminBERTLVFileView
The
All the methods are based on the commands of the TS 102 221 specification.
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 Summary
Modifier and TypeMethodDescriptionvoiddeleteData(int tag) This method deletes a data object in the current BER-TLV structure EF.intgetTAGList(byte mode, int[] responseBuffer, short responseOffset, short responseLength) This method gets the list of TAGs already allocated in the current BER-TLV structure EF.intretrieveData(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.intsetData(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.Methods inherited from interface uicc.access.FileView
activateFile, deactivateFile, increase, readBinary, readRecord, searchRecord, select, select, select, status, updateBinary, updateRecord
-
Method Details
-
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
responseOffsetorresponseLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
responseOffset+responseLengthis greater thanresponseBuffer.length, the length of theresponseBufferarray aArrayIndexOutOfBoundsExceptionexception is thrown and no read is performed. - If
tagvalue is invalid or is equal to '5C', anUICCExceptionwith reason codeINVALID_TAG_VALUEis 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:
NullPointerException- ifresponseBufferisnullArrayIndexOutOfBoundsException- if reading would cause access of data outside array boundsUICCException- in case of errorINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDNO_EF_SELECTEDREFERENCED_DATA_NOT_FOUNDCONDITIONS_OF_USE_NOT_SATISFIEDOUT_OF_DATA_BOUNDARIESINVALID_TAG_VALUE
- The TAG and Length of the requested data object are not copied in
-
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
responseOffsetorresponseLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
responseOffset+responseLengthis greater thanresponseBuffer.length, the length of theresponseBufferarray aArrayIndexOutOfBoundsExceptionexception 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 theresponseBufferarray 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:
NullPointerException- ifresponseBufferisnullArrayIndexOutOfBoundsException- if reading would cause access of data outside array boundsUICCException- in case of errorINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDNO_EF_SELECTEDINVALID_MODECONDITIONS_OF_USE_NOT_SATISFIEDOUT_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
offsetorlengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
offset+lengthis greater thandata.length, the length of thedataarray aArrayIndexOutOfBoundsExceptionexception is thrown and no update is performed. - If
modeisBER_TLV_ACC_MODE_FIRSTandlengthis greater thanvalueFieldLength, anUICCExceptionexception with reason codeOUT_OF_DATA_BOUNDARIESis thrown and no object is created. - If
modeisBER_TLV_ACC_MODE_NEXTand the cumulative sum oflengthis greater thanvalueFieldLengthprovided in the call to this method withBER_TLV_ACC_MODE_FIRST, anUICCExceptionexception with reason codeOUT_OF_DATA_BOUNDARIESis thrown. - It is implementation dependant to throw
UICCExceptionexception with reason codeOUT_OF_DATA_BOUNDARIESorArrayIndexOutOfBoundsException, if conditions are met to thrown both exceptions. - If
modeisBER_TLV_ACC_MODE_FIRSTandvalueFieldLengthis equal to 0, a zero length object is created. - If
tagvalue is invalid or is equal to '5C', anUICCExceptionwith reason codeINVALID_TAG_VALUEis thrown
- Parameters:
tag- is the TAG value of TLV object that shall be set. The value is not significant ifmodeparameter 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 ifmodeparameter 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:
NullPointerException- ifdataisnullArrayIndexOutOfBoundsException- if reading would cause access of data outside array boundsUICCException- in case of errorINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDNO_EF_SELECTEDINVALID_MODEMEMORY_PROBLEMREFERENCED_DATA_NOT_FOUNDNOT_ENOUGH_MEMORY_SPACECONDITIONS_OF_USE_NOT_SATISFIEDOUT_OF_DATA_BOUNDARIESINVALID_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
- When deleting a non existent tag the bahaviour is implementation specific. The
execution may be successful or the method may throw a
UICCExceptionwith reason codeREFERENCED_DATA_NOT_FOUNDorINVALID_TAG_VALUE - If
tagvalue is invalid or is equal to '5C', aUICCExceptionwith reason codeINVALID_TAG_VALUEis thrown
- Parameters:
tag- is the TAG value of TLV object that shall be deleted.- Throws:
UICCException- in case of errorINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREFERENCED_DATA_NOT_FOUNDCONDITIONS_OF_USE_NOT_SATISFIEDNO_EF_SELECTEDINVALID_TAG_VALUE
-