Package uicc.access
Interface FileView
-
- All Superinterfaces:
javacard.framework.Shareable
- All Known Subinterfaces:
AdminBERTLVFileView,AdminFileView,BERTLVFileView
public interface FileView extends javacard.framework.ShareableTheFileViewinterface defines the methods to access a UICC file system.
All the methods are based on the commands of the TS 102 221 specification.- See Also:
UICCSystem
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateFile()This method activates a deactivated EF.voiddeactivateFile()This method deactivates the currently selected EF.shortincrease(byte[] incr, short incrOffset, short incrLength, byte[] resp, short respOffset)This method increases the current cyclic EF record, as defined in TS 102 221.In addition to the behaviour defined in TS 102 221, the following rule applies: If the parameter incrLength is set to 0, the current value of the last increased or updated record is stored into the oldest record of the current cyclic EF.shortreadBinary(short fileOffset, byte[] resp, short respOffset, short respLength)This method reads the data bytes of the current transparent EF.shortreadRecord(short recNumber, byte mode, short recOffset, byte[] resp, short respOffset, short respLength)This method reads a record or a part of a record of the current linear fixed/cyclic EF of the calling applet into the given byte array.shortsearchRecord(byte mode, short recordNum, short searchIndication, byte[] patt, short pattOffset, short pattLength, short[] response, short respOffset, short respLength)This method searches a pattern in the current linear fixed/cyclic EF.voidselect(byte sfi)This method selects a file by SFI in the current directory of the FileView.
The file context associated with the FileView object is changed after successful execution.voidselect(short fid)This method selects a file of the UICC file system or of an ADF file system.shortselect(short fid, byte[] fcp, short fcpOffset, short fcpLength)This method selects a file of the UICC file system or of an ADF file system.shortstatus(byte[] fcp, short fcpOffset, short fcpLength)This method returns the FCP (File Control Parameter) of the current selected DF.voidupdateBinary(short fileOffset, byte[] data, short dataOffset, short dataLength)This method updates the data bytes of the current transparent EF.voidupdateRecord(short recNumber, byte mode, short recOffset, byte[] data, short dataOffset, short dataLength)This method updates the data bytes of the record of the current linear fixed/cyclic EF.
-
-
-
Method Detail
-
select
short select(short fid, byte[] fcp, short fcpOffset, short fcpLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method selects a file of the UICC file system or of an ADF file system. The file search starts at the current DF of the FileView according to the file search method described in TS 102 221. The file context associated with the FileView object is changed after successful execution. This methods returns the FCP informations in form of a TLV structure as specified in TS 102 221.Notes:
- If
fcpOffsetorfcpLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
fcpOffset+fcpLengthis greater thanfcp.length, the length of thefcparray aArrayIndexOutOfBoundsExceptionexception is thrown and no status is performed.
- Parameters:
fid- is the File Identifier of the file to be selected.fcp- is the reference to the target byte array for information of current file, coding is according to TS 102.221.fcpOffset- is the offset in thefcpbuffer for the response data.fcpLength- is the length of the required data in thefcpbyte array. If thefcpLengthis greater than the length of the response, the whole response is copied into thefcpbuffer and the length of the response is returned by the method. If thefcpLengthis smaller than the length of the response, the first part of the response is copied into thefcpbuffer and thefcpLengthis returned by the method.- Returns:
- length of the data which have been written in the
fcpbuffer (cannot be greater thanfcpLengthparameter) - Throws:
java.lang.NullPointerException- iffcpisnulljava.lang.ArrayIndexOutOfBoundsException- if operation would cause access of data outside array bounds.UICCException- in case of errorFILE_NOT_FOUNDMEMORY_PROBLEMINTERNAL_ERRORCONDITIONS_OF_USE_NOT_SATISFIED
- If
-
select
void select(short fid) throws UICCExceptionThis method selects a file of the UICC file system or of an ADF file system. The file search starts at the current DF of the FileView according to the file search method described in TS 102 221. The file context associated with the FileView object is changed after successful execution. This SELECT method allows to update the current file without handling the Select Response.- Parameters:
fid- is the File Identifier of the file to be selected.- Throws:
UICCException- in case of errorFILE_NOT_FOUNDMEMORY_PROBLEMINTERNAL_ERRORCONDITIONS_OF_USE_NOT_SATISFIED
-
select
void select(byte sfi) throws UICCExceptionThis method selects a file by SFI in the current directory of the FileView.
The file context associated with the FileView object is changed after successful execution. This SELECT method allows to update the current file without handling the Select Response.- Parameters:
sfi- is the Short File Identifier of the file to be selected.- Throws:
UICCException- in case of errorFILE_NOT_FOUNDif a file with the corresponding SFI is not found or if thesfiparameter is invalid.MEMORY_PROBLEMINTERNAL_ERRORCONDITIONS_OF_USE_NOT_SATISFIED
-
status
short status(byte[] fcp, short fcpOffset, short fcpLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method returns the FCP (File Control Parameter) of the current selected DF.Notes:
- If
fcpOffsetorfcpLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
fcpOffset+fcpLengthis greater thanfcp.length, the length of thefcparray aArrayIndexOutOfBoundsExceptionexception is thrown and no status is performed.
- Parameters:
fcp- is the reference to the target byte array for FCP (File Control Parameter) of current DF (or MF), coding is according to TS 102.221.fcpOffset- is the offset in thefcpbuffer for the response data.fcpLength- is the length of the required data in thefcpbyte array. If thefcpLengthis greater than the length of the response, the whole response is copied into thefcpbuffer and the length of the response is returned by the method. If thefcplengthis smaller than the length of the response, the first part of the response is copied into thefcpbuffer and thefcpLengthis returned by the method.- Returns:
- length of the data which have been written in the
fcpbuffer (cannot be greater thanfcpLengthparameter) - Throws:
java.lang.NullPointerException- iffcpisnulljava.lang.ArrayIndexOutOfBoundsException- if operation would cause access of data outside array bounds.UICCException- in case of errorMEMORY_PROBLEMINTERNAL_ERROR
- If
-
readBinary
short readBinary(short fileOffset, byte[] resp, short respOffset, short respLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method reads the data bytes of the current transparent EF.Notes:
- If
respOffsetorrespLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
respOffset+respLengthis greater thanresp.length, the length of theresparray aArrayIndexOutOfBoundsExceptionexception is thrown and no read is performed.
- Parameters:
fileOffset- is the offset in the source transparent file.resp- is the reference to the response byte array for read data.respOffset- is the offset in the response byte array.respLength- is the number of bytes to read.- Returns:
respOffset+respLength- Throws:
java.lang.NullPointerException- ifrespisnulljava.lang.ArrayIndexOutOfBoundsException- if reading would cause access of data outside array boundsUICCException- in case of errorINTERNAL_ERROROUT_OF_FILE_BOUNDARIESCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDNO_EF_SELECTEDCOMMAND_NOT_ALLOWEDif the referenced file is terminated
- If
-
updateBinary
void updateBinary(short fileOffset, byte[] data, short dataOffset, short dataLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method updates the data bytes of the current transparent EF.Notes:
- If
dataOffsetordataLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
dataOffset+dataLengthis greater thandata.length, the length of thedataarray aArrayIndexOutOfBoundsExceptionexception is thrown and no update is performed.
- Parameters:
fileOffset- is the offset in the destination transparent file.data- is the reference to the source byte array for data to update.dataOffset- is the offset in the data byte array.dataLength- is the number of bytes to update.- Throws:
java.lang.NullPointerException- ifdataisnulljava.lang.ArrayIndexOutOfBoundsException- if updating would cause access of data outside array boundsUICCException- in case of errorMEMORY_PROBLEMINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDNO_EF_SELECTEDOUT_OF_FILE_BOUNDARIESCOMMAND_NOT_ALLOWEDif the referenced file is terminated
- If
-
readRecord
short readRecord(short recNumber, byte mode, short recOffset, byte[] resp, short respOffset, short respLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method reads a record or a part of a record of the current linear fixed/cyclic EF of the calling applet into the given byte array. The current record pointer can be changed due to the chosen mode.Notes:
- If
respOffsetorrespLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
respOffset+respLengthis greater thanresp.length, the length of theresparray aArrayIndexOutOfBoundsExceptionexception is thrown and no read is performed.
- Parameters:
recNumber- is the record number (for absolute mode only)mode- is the mode for reading recordrecOffset- is the offset in the record for the data to read.resp- is the reference to the response byte array for read data.respOffset- is the offset in the response byte array.respLength- is the number of bytes to read.- Returns:
respOffset+respLength- Throws:
java.lang.NullPointerException- ifrespisnulljava.lang.ArrayIndexOutOfBoundsException- if reading would cause access of data outside array boundsUICCException- in case of errorOUT_OF_RECORD_BOUNDARIESINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDNO_EF_SELECTEDINVALID_MODERECORD_NOT_FOUNDCOMMAND_NOT_ALLOWEDif the referenced file is terminated
- If
-
updateRecord
void updateRecord(short recNumber, byte mode, short recOffset, byte[] data, short dataOffset, short dataLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method updates the data bytes of the record of the current linear fixed/cyclic EF. The current record pointer can be changed due to the chosen mode.Notes:
- If
dataOffsetordataLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
dataOffset+dataLengthis greater thandata.length, the length of thedataarray aArrayIndexOutOfBoundsExceptionexception is thrown and no update is performed.
- Parameters:
recNumber- is the record number, if null then mode is usedmode- is the mode for updating record, ifrecNumberis given then mode is in ABSOLUTE moderecOffset- is the offset in the record for the data to update.data- is the reference to the source byte array for data to update.dataOffset- is the offset in the source byte array.dataLength- is the number of bytes to update.- Throws:
java.lang.NullPointerException- ifdataisnulljava.lang.ArrayIndexOutOfBoundsException- if updating would cause access of data outside array boundsUICCException- in case of errorCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDOUT_OF_RECORD_BOUNDARIESRECORD_NOT_FOUNDNO_EF_SELECTEDMEMORY_PROBLEMINVALID_MODEINTERNAL_ERRORCOMMAND_NOT_ALLOWEDif the referenced file is terminated
- If
-
searchRecord
short searchRecord(byte mode, short recordNum, short searchIndication, byte[] patt, short pattOffset, short pattLength, short[] response, short respOffset, short respLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method searches a pattern in the current linear fixed/cyclic EF.Notes:
- If
patOffsetorpattLengthorrespOffsetorrespLengthparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
pattOffset+pattLengthis greater thanpatt.length, the length of thepattarray aArrayIndexOutOfBoundsExceptionexception is thrown and no search is performed. - If
respOffset+respLengthis greater thanresponse.length, the length of theresponsearray aArrayIndexOutOfBoundsExceptionexception is thrown and no search is performed.
- Parameters:
mode- is the search mode, according to TS 102.221 (no type information).recordNum- is the record number to start the search, 0 indicates from the current recordsearchIndication- indication of the search mode for the enhanced searchpatt- is the reference to the byte array containing the search pattern.pattOffset- is the offset of the search pattern in the byte array.pattLength- is the length of the search pattern.response- reference to response array to hold the record numbersrespOffset- is the offset into the response array to store the record numbersrespLength- - is the maximum number of elements to be copied into the response array. If therespLengthis greater than the number of records found, the whole response is copied into the response buffer and the number of elements copied is returned by the method. If therespLengthis smaller than the number of records found, the first respLength record numbers are copied into the response buffer andrespLengthis returned by the method.- Returns:
- number of array elements copied into the response array. Returns 0 if no record containing containing the pattern was found.
- Throws:
java.lang.NullPointerException- ifpattisnulljava.lang.ArrayIndexOutOfBoundsException- if searching would cause access of data outside array boundsUICCException- in case of errorINTERNAL_ERROROUT_OF_RECORD_BOUNDARIESifpattLengthis greater than the record sizeCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDNO_EF_SELECTEDRECORD_NOT_FOUND: record with number recordNum not found in fileINVALID_MODECOMMAND_NOT_ALLOWEDif the referenced file is terminated
- If
-
increase
short increase(byte[] incr, short incrOffset, short incrLength, byte[] resp, short respOffset) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, UICCExceptionThis method increases the current cyclic EF record, as defined in TS 102 221.In addition to the behaviour defined in TS 102 221, the following rule applies: If the parameter incrLength is set to 0, the current value of the last increased or updated record is stored into the oldest record of the current cyclic EF. The record pointer is set to the oldest record and this record becomes record number 1. The response buffer will contain the value of the increased record.Notes:
- If
incrOffsetorincrLengthorrespOffsetparameter is negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
incrOffset+incrLengthis greater thanincrease.length, the length of theincreasearray anArrayIndexOutOfBoundsExceptionexception is thrown and no increase is performed. - If
respOffsetis greater thanresponse.length, the length of theresponsearray aArrayIndexOutOfBoundsExceptionexception is thrown and no increase is performed.
- Parameters:
incr- is the reference to the source byte array, containing the value to increase. The increase is only performed if the result would not exceed the maximum value of the record.incrOffset- is the offset in the source byte array.incrLength- is the length of the data in theincrarray, 0<=incrLength<128resp- is the reference to the response byte array for the new record value. Ifrespbuffer is bigger than the record size, therespbuffer is filled with the record value and left justified.respOffset- is the offset in the response byte array.- Returns:
- length of the valid data in the resp buffer
- Throws:
java.lang.NullPointerException- ifincrorrespisnulljava.lang.ArrayIndexOutOfBoundsException- if increasing would cause access of data outside array boundsUICCException- in case of errorNO_EF_SELECTEDMEMORY_PROBLEMINTERNAL_ERRORCOMMAND_INCOMPATIBLESECURITY_STATUS_NOT_SATISFIEDREF_DATA_INVALIDATEDRECORD_NOT_FOUNDMAX_VALUE_REACHEDCOMMAND_NOT_ALLOWEDif the referenced file is terminated
- If
-
deactivateFile
void deactivateFile() throws UICCExceptionThis method deactivates the currently selected EF. No exception shall be thrown when deactivating an already deactivated EF.- Throws:
UICCException- in case of errorNO_EF_SELECTEDSECURITY_STATUS_NOT_SATISFIEDINTERNAL_ERRORCOMMAND_NOT_ALLOWEDif the referenced file is terminated
-
activateFile
void activateFile() throws UICCExceptionThis method activates a deactivated EF. No exception shall be thrown when activating an already activated EF.- Throws:
UICCException- in case of errorNO_EF_SELECTEDSECURITY_STATUS_NOT_SATISFIEDINTERNAL_ERRORCOMMAND_NOT_ALLOWEDif the referenced file is terminated
-
-