com.cryptware.jscapi
Class ResponseAPDU

java.lang.Object
  extended by com.cryptware.jscapi.ResponseAPDU

public class ResponseAPDU
extends java.lang.Object

Implements an APDU Response The response from the smart card after a command is codified in a Response APDU. The response APDU is composed by an optional DATA field followed by two mandatory bytes, SW1 (Status Word 1) and SW2 (Status Word 2), called Status Words. SW1 and SW2 hold the final processing status which specifies a successful processing or an error if one has occurred. Specifically, SW1 = 0x90 and e SW2 = 0x00 indicate a successful command. In that case the DATA field contains the response of the processing (if any, depending on the command). If the response to a command contains more bytes than what is expected (i.e. it is longer than the value specified on LE field) SW1 is set to 0x91 or to 0x61 and SW2 is set to the number of bytes still available. Other values for SW1/SW2 indicate an error condition as defined by Part 4 of the standard.

Author:
ugo

Method Summary
 byte[] getBytes()
           
 byte[] getData()
           
 short getSW1()
           
 short getSW1SW2()
           
 short getSW2()
           
 boolean isSuccess()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isSuccess

public boolean isSuccess()
Returns:
true if the command has been executed successfully

getSW1

public short getSW1()
Returns:
SW1

getSW2

public short getSW2()
Returns:
SW2

getData

public byte[] getData()
Returns:
DATA

getSW1SW2

public short getSW1SW2()
Returns:
SW1SW2

getBytes

public byte[] getBytes()