Response APDU structure

2011. 9. 28. 18:52IT관련

반응형
Command APDU의 응답으로 Response APDU를 반환해야 한다.
Response APDU는 아래와 같이 구성된다.

Contents of Response APDU
Code Length Description M/O
Data Lr Response data string Optional
SW1 1 Status byte 1 Mandatory
SW2 1 Status byte 2 Mandatory


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

Normal processing
SW1 SW2 Description 
90 00 - Normal ending of the command
91 XX - Normal ending of the command, with extra information from the proactive UICC containing a command for the terminal. Length 'XX' of the response data.
92 XX - Normal ending of the command, with extra information concerning an ongoing data transfer session.

Postponed processing
SW1 SW2 Description 
93 00 - SIM Application Toolkit is busy. Command cannot be executed at present, further normal commands are allowed.

Warning
SW1 SW2 Description 
62 00 - No information given, state of non volatile memory unchanged.
62 81 - Part of returned data may be corrupted.
62 82 - End of file/record reached before reading Le bytes.
62 83 - Selected file invalidated.
62 85 - Selected file in termination state.
62 F1 - More data available.
62 F2 - More data available and proactive command pending.
62 F3 - Response data available.
63 F1 - More data expected.
63 F2 - More data expected and proactive command pending.
63 CX - 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
SW1 SW2 Description 
64 00 - No information given, state of non-volatile memory unchanged.
65 00 - No information given, state of non-volatile memory changed.
65 81 - Memory problem.

Checking errors
SW1 SW2 Description 
67 00 - Wrong length
67 XX - The interpretation of this status word is command dependent, except for SW2 = '00'
6B 00 - Wrong parameter(s) P1-P2
6D 00 - Instruction code not supported or invalid.
6E 00 - Class not supported.
6F 00 - Technical problem, no precise diagnosis.
6F XX - The interpretation of this status word is command dependent, except for SW2 = '00'

Functions in CLA not supported
SW1 SW2 Description 
68 00 - No information given
68 81 - Logical channel not supported
68 82 - Secure messaging not supported

Command not allowed
SW1 SW2 Description 
69 00 - No information given
69 81 - Command incompatible with fire structure
69 82 - Secure status not satisfied
69 83 - Authentication/PIN method blocked
69 84 - Referenced data invalidated
69 85 - Conditions of use not satisfied
69 86 - Command not allowed (no EF selected)
69 89 - Command not allowed - secure channel - security not satisfied

Wrong parameters
SW1 SW2 Description 
6A 80 - Incorrect parameters in the data field.
6A 81 - Function not supported.
6A 82 - File not found.
6A 83 - Record not found.
6A 84 - Not enough memory space.
6A 86 - Incorrect parameters P1 to P2.
6A 87 - Lc inconsistent with P1 to P2.
6A 88 - Referenced data not found.

Application errors
SW1 SW2 Description 
98 50 - INCREASE cannot be performed, max value reached.
98 62 - Authentication error, application specific.
98 63 - Security session or association expired.
NOTE: Applications may define their own error codes.

 
반응형

'IT관련' 카테고리의 다른 글

0x60 (Null byte)  (0) 2011.09.29
EF DIR  (0) 2011.09.29
Command APDU structure  (4) 2011.09.28
IMSI를 이용한 IMSI_M 구하기  (0) 2011.09.28
PLMN(Public Land Mobile Network)  (0) 2011.09.23