[SIM/USIM/ICC] Response APDU structure

2016. 4. 14. 15:11Mobile/SIM

Contents of Response APDU

CodeLengthDescriptionM/O
DataLrResponse data stringOptional
SW11Status byte 1Mandatory
SW21Status byte 2Mandatory


SW1, SW2를 Status Word라 부르며, 다음과 같은 응답값을 가진다.

Normal processing

SW1SW2Description 
9000- Normal ending of the command
91XX- Normal ending of the command, with extra information from the proactive UICC containing a command for the terminal. Length 'XX' of the response data.
92XX- Normal ending of the command, with extra information concerning an ongoing data transfer session.


Postponed processing

SW1SW2Description 
9300- SIM Application Toolkit is busy. Command cannot be executed at present, further normal commands are allowed.


Warning

SW1SW2Description 
6200- No information given, state of non volatile memory unchanged.
6281- Part of returned data may be corrupted.
6282- End of file/record reached before reading Le bytes.
6283- Selected file invalidated.
6285- Selected file in termination state.
62F1- More data available.
62F2- More data available and proactive command pending.
62F3- Response data available.
63F1- More data expected.
63F2- More data expected and proactive command pending.
63CX- Command successful but after using an internal update retry roution 'X' times
- Verification failed, 'X' retries remaining (see note)
NOTE:For the VERIFY PIN command, SW1SW2 indicates that the command was successful but the PIN was not correct and there are 'X' retries left. For all other commands it indicates the number of internal retries performed by the card to complete the command.


Execution errors

SW1SW2Description 
6400- No information given, state of non-volatile memory unchanged.
6500- No information given, state of non-volatile memory changed.
6581- Memory problem.


Checking errors

SW1SW2Description 
6700- Wrong length
67XX- The interpretation of this status word is command dependent, except for SW2 = '00'
6B00- Wrong parameter(s) P1-P2
6D00- Instruction code not supported or invalid.
6E00- Class not supported.
6F00- Technical problem, no precise diagnosis.
6FXX- The interpretation of this status word is command dependent, except for SW2 = '00'


Functions in CLA not supported

SW1SW2Description 
6800- No information given
6881- Logical channel not supported
6882- Secure messaging not supported


Command not allowed

SW1SW2Description 
6900- No information given
6981- Command incompatible with fire structure
6982- Secure status not satisfied
6983- Authentication/PIN method blocked
6984- Referenced data invalidated
6985- Conditions of use not satisfied
6986- Command not allowed (no EF selected)
6989- Command not allowed - secure channel - security not satisfied


Wrong parameters

SW1SW2Description 
6A80- Incorrect parameters in the data field.
6A81- Function not supported.
6A82- File not found.
6A83- Record not found.
6A84- Not enough memory space.
6A86- Incorrect parameters P1 to P2.
6A87- Lc inconsistent with P1 to P2.
6A88- Referenced data not found.


Application errors

SW1SW2Description 
9850- INCREASE cannot be performed, max value reached.
9862- Authentication error, application specific.
9863- Security session or association expired.
NOTE:Applications may define their own error codes.