104 *
105 * @return the value of the status byte SW1 as a value between 0 and 255.
106 */
107 public int getSW1() {
108 return apdu[apdu.length - 2] & 0xff;
109 }
110
111 /**
112 * Returns the value of the status byte SW2 as a value between 0 and 255.
113 *
114 * @return the value of the status byte SW2 as a value between 0 and 255.
115 */
116 public int getSW2() {
117 return apdu[apdu.length - 1] & 0xff;
118 }
119
120 /**
121 * Returns the value of the status bytes SW1 and SW2 as a single
122 * status word SW.
123 * It is defined as
124 * <code>(getSW1() << 8) | getSW2()</code>.
125 *
126 * @return the value of the status word SW.
127 */
128 public int getSW() {
129 return (getSW1() << 8) | getSW2();
130 }
131
132 /**
133 * Returns a copy of the bytes in this APDU.
134 *
135 * @return a copy of the bytes in this APDU.
136 */
137 public byte[] getBytes() {
138 return apdu.clone();
139 }
140
141 /**
142 * Returns a string representation of this response APDU.
143 *
144 * @return a String representation of this response APDU.
|
104 *
105 * @return the value of the status byte SW1 as a value between 0 and 255.
106 */
107 public int getSW1() {
108 return apdu[apdu.length - 2] & 0xff;
109 }
110
111 /**
112 * Returns the value of the status byte SW2 as a value between 0 and 255.
113 *
114 * @return the value of the status byte SW2 as a value between 0 and 255.
115 */
116 public int getSW2() {
117 return apdu[apdu.length - 1] & 0xff;
118 }
119
120 /**
121 * Returns the value of the status bytes SW1 and SW2 as a single
122 * status word SW.
123 * It is defined as
124 * {@code (getSW1() << 8) | getSW2()}
125 *
126 * @return the value of the status word SW.
127 */
128 public int getSW() {
129 return (getSW1() << 8) | getSW2();
130 }
131
132 /**
133 * Returns a copy of the bytes in this APDU.
134 *
135 * @return a copy of the bytes in this APDU.
136 */
137 public byte[] getBytes() {
138 return apdu.clone();
139 }
140
141 /**
142 * Returns a string representation of this response APDU.
143 *
144 * @return a String representation of this response APDU.
|