0N/A/*
2362N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.smartcardio;
0N/A
0N/Aimport java.util.Arrays;
0N/A
0N/Aimport java.nio.ByteBuffer;
0N/A
0N/A/**
0N/A * A command APDU following the structure defined in ISO/IEC 7816-4.
0N/A * It consists of a four byte header and a conditional body of variable length.
0N/A * This class does not attempt to verify that the APDU encodes a semantically
0N/A * valid command.
0N/A *
0N/A * <p>Note that when the expected length of the response APDU is specified
0N/A * in the {@linkplain #CommandAPDU(int,int,int,int,int) constructors},
0N/A * the actual length (Ne) must be specified, not its
0N/A * encoded form (Le). Similarly, {@linkplain #getNe} returns the actual
0N/A * value Ne. In other words, a value of 0 means "no data in the response APDU"
0N/A * rather than "maximum length."
0N/A *
0N/A * <p>This class supports both the short and extended forms of length
0N/A * encoding for Ne and Nc. However, note that not all terminals and Smart Cards
0N/A * are capable of accepting APDUs that use the extended form.
0N/A *
0N/A * <p>For the header bytes CLA, INS, P1, and P2 the Java type <code>int</code>
0N/A * is used to represent the 8 bit unsigned values. In the constructors, only
0N/A * the 8 lowest bits of the <code>int</code> value specified by the application
0N/A * are significant. The accessor methods always return the byte as an unsigned
0N/A * value between 0 and 255.
0N/A *
0N/A * <p>Instances of this class are immutable. Where data is passed in or out
0N/A * via byte arrays, defensive cloning is performed.
0N/A *
0N/A * @see ResponseAPDU
0N/A * @see CardChannel#transmit CardChannel.transmit
0N/A *
0N/A * @since 1.6
0N/A * @author Andreas Sterbenz
0N/A * @author JSR 268 Expert Group
0N/A */
0N/Apublic final class CommandAPDU implements java.io.Serializable {
0N/A
0N/A private static final long serialVersionUID = 398698301286670877L;
0N/A
0N/A private static final int MAX_APDU_SIZE = 65544;
0N/A
0N/A /** @serial */
0N/A private byte[] apdu;
0N/A
0N/A // value of nc
0N/A private transient int nc;
0N/A
0N/A // value of ne
0N/A private transient int ne;
0N/A
0N/A // index of start of data within the apdu array
0N/A private transient int dataOffset;
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from a byte array containing the complete
0N/A * APDU contents (header and body).
0N/A *
0N/A * <p>Note that the apdu bytes are copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param apdu the complete command APDU
0N/A *
0N/A * @throws NullPointerException if apdu is null
0N/A * @throws IllegalArgumentException if apdu does not contain a valid
0N/A * command APDU
0N/A */
0N/A public CommandAPDU(byte[] apdu) {
0N/A this.apdu = apdu.clone();
0N/A parse();
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from a byte array containing the complete
0N/A * APDU contents (header and body). The APDU starts at the index
0N/A * <code>apduOffset</code> in the byte array and is <code>apduLength</code>
0N/A * bytes long.
0N/A *
0N/A * <p>Note that the apdu bytes are copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param apdu the complete command APDU
0N/A * @param apduOffset the offset in the byte array at which the apdu
0N/A * data begins
0N/A * @param apduLength the length of the APDU
0N/A *
0N/A * @throws NullPointerException if apdu is null
0N/A * @throws IllegalArgumentException if apduOffset or apduLength are
0N/A * negative or if apduOffset + apduLength are greater than apdu.length,
0N/A * or if the specified bytes are not a valid APDU
0N/A */
0N/A public CommandAPDU(byte[] apdu, int apduOffset, int apduLength) {
0N/A checkArrayBounds(apdu, apduOffset, apduLength);
0N/A this.apdu = new byte[apduLength];
0N/A System.arraycopy(apdu, apduOffset, this.apdu, 0, apduLength);
0N/A parse();
0N/A }
0N/A
0N/A private void checkArrayBounds(byte[] b, int ofs, int len) {
0N/A if ((ofs < 0) || (len < 0)) {
0N/A throw new IllegalArgumentException
0N/A ("Offset and length must not be negative");
0N/A }
0N/A if (b == null) {
0N/A if ((ofs != 0) && (len != 0)) {
0N/A throw new IllegalArgumentException
0N/A ("offset and length must be 0 if array is null");
0N/A }
0N/A } else {
0N/A if (ofs > b.length - len) {
0N/A throw new IllegalArgumentException
0N/A ("Offset plus length exceed array size");
0N/A }
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Creates a CommandAPDU from the ByteBuffer containing the complete APDU
0N/A * contents (header and body).
0N/A * The buffer's <code>position</code> must be set to the start of the APDU,
0N/A * its <code>limit</code> to the end of the APDU. Upon return, the buffer's
0N/A * <code>position</code> is equal to its limit; its limit remains unchanged.
0N/A *
0N/A * <p>Note that the data in the ByteBuffer is copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param apdu the ByteBuffer containing the complete APDU
0N/A *
0N/A * @throws NullPointerException if apdu is null
0N/A * @throws IllegalArgumentException if apdu does not contain a valid
0N/A * command APDU
0N/A */
0N/A public CommandAPDU(ByteBuffer apdu) {
0N/A this.apdu = new byte[apdu.remaining()];
0N/A apdu.get(this.apdu);
0N/A parse();
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from the four header bytes. This is case 1
0N/A * in ISO 7816, no command body.
0N/A *
0N/A * @param cla the class byte CLA
0N/A * @param ins the instruction byte INS
0N/A * @param p1 the parameter byte P1
0N/A * @param p2 the parameter byte P2
0N/A */
0N/A public CommandAPDU(int cla, int ins, int p1, int p2) {
0N/A this(cla, ins, p1, p2, null, 0, 0, 0);
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from the four header bytes and the expected
0N/A * response data length. This is case 2 in ISO 7816, empty command data
0N/A * field with Ne specified. If Ne is 0, the APDU is encoded as ISO 7816
0N/A * case 1.
0N/A *
0N/A * @param cla the class byte CLA
0N/A * @param ins the instruction byte INS
0N/A * @param p1 the parameter byte P1
0N/A * @param p2 the parameter byte P2
0N/A * @param ne the maximum number of expected data bytes in a response APDU
0N/A *
0N/A * @throws IllegalArgumentException if ne is negative or greater than
0N/A * 65536
0N/A */
0N/A public CommandAPDU(int cla, int ins, int p1, int p2, int ne) {
0N/A this(cla, ins, p1, p2, null, 0, 0, ne);
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from the four header bytes and command data.
0N/A * This is case 3 in ISO 7816, command data present and Ne absent. The
0N/A * value Nc is taken as data.length. If <code>data</code> is null or
0N/A * its length is 0, the APDU is encoded as ISO 7816 case 1.
0N/A *
0N/A * <p>Note that the data bytes are copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param cla the class byte CLA
0N/A * @param ins the instruction byte INS
0N/A * @param p1 the parameter byte P1
0N/A * @param p2 the parameter byte P2
0N/A * @param data the byte array containing the data bytes of the command body
0N/A *
0N/A * @throws IllegalArgumentException if data.length is greater than 65535
0N/A */
0N/A public CommandAPDU(int cla, int ins, int p1, int p2, byte[] data) {
0N/A this(cla, ins, p1, p2, data, 0, arrayLength(data), 0);
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from the four header bytes and command data.
0N/A * This is case 3 in ISO 7816, command data present and Ne absent. The
0N/A * value Nc is taken as dataLength. If <code>dataLength</code>
0N/A * is 0, the APDU is encoded as ISO 7816 case 1.
0N/A *
0N/A * <p>Note that the data bytes are copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param cla the class byte CLA
0N/A * @param ins the instruction byte INS
0N/A * @param p1 the parameter byte P1
0N/A * @param p2 the parameter byte P2
0N/A * @param data the byte array containing the data bytes of the command body
0N/A * @param dataOffset the offset in the byte array at which the data
0N/A * bytes of the command body begin
0N/A * @param dataLength the number of the data bytes in the command body
0N/A *
0N/A * @throws NullPointerException if data is null and dataLength is not 0
0N/A * @throws IllegalArgumentException if dataOffset or dataLength are
0N/A * negative or if dataOffset + dataLength are greater than data.length
0N/A * or if dataLength is greater than 65535
0N/A */
0N/A public CommandAPDU(int cla, int ins, int p1, int p2, byte[] data,
0N/A int dataOffset, int dataLength) {
0N/A this(cla, ins, p1, p2, data, dataOffset, dataLength, 0);
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from the four header bytes, command data,
0N/A * and expected response data length. This is case 4 in ISO 7816,
0N/A * command data and Ne present. The value Nc is taken as data.length
0N/A * if <code>data</code> is non-null and as 0 otherwise. If Ne or Nc
0N/A * are zero, the APDU is encoded as case 1, 2, or 3 per ISO 7816.
0N/A *
0N/A * <p>Note that the data bytes are copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param cla the class byte CLA
0N/A * @param ins the instruction byte INS
0N/A * @param p1 the parameter byte P1
0N/A * @param p2 the parameter byte P2
0N/A * @param data the byte array containing the data bytes of the command body
0N/A * @param ne the maximum number of expected data bytes in a response APDU
0N/A *
0N/A * @throws IllegalArgumentException if data.length is greater than 65535
0N/A * or if ne is negative or greater than 65536
0N/A */
0N/A public CommandAPDU(int cla, int ins, int p1, int p2, byte[] data, int ne) {
0N/A this(cla, ins, p1, p2, data, 0, arrayLength(data), ne);
0N/A }
0N/A
0N/A private static int arrayLength(byte[] b) {
0N/A return (b != null) ? b.length : 0;
0N/A }
0N/A
0N/A /**
0N/A * Command APDU encoding options:
0N/A *
0N/A * case 1: |CLA|INS|P1 |P2 | len = 4
0N/A * case 2s: |CLA|INS|P1 |P2 |LE | len = 5
0N/A * case 3s: |CLA|INS|P1 |P2 |LC |...BODY...| len = 6..260
0N/A * case 4s: |CLA|INS|P1 |P2 |LC |...BODY...|LE | len = 7..261
0N/A * case 2e: |CLA|INS|P1 |P2 |00 |LE1|LE2| len = 7
0N/A * case 3e: |CLA|INS|P1 |P2 |00 |LC1|LC2|...BODY...| len = 8..65542
0N/A * case 4e: |CLA|INS|P1 |P2 |00 |LC1|LC2|...BODY...|LE1|LE2| len =10..65544
0N/A *
0N/A * LE, LE1, LE2 may be 0x00.
0N/A * LC must not be 0x00 and LC1|LC2 must not be 0x00|0x00
0N/A */
0N/A private void parse() {
0N/A if (apdu.length < 4) {
0N/A throw new IllegalArgumentException("apdu must be at least 4 bytes long");
0N/A }
0N/A if (apdu.length == 4) {
0N/A // case 1
0N/A return;
0N/A }
0N/A int l1 = apdu[4] & 0xff;
0N/A if (apdu.length == 5) {
0N/A // case 2s
0N/A this.ne = (l1 == 0) ? 256 : l1;
0N/A return;
0N/A }
0N/A if (l1 != 0) {
0N/A if (apdu.length == 4 + 1 + l1) {
0N/A // case 3s
0N/A this.nc = l1;
0N/A this.dataOffset = 5;
0N/A return;
0N/A } else if (apdu.length == 4 + 2 + l1) {
0N/A // case 4s
0N/A this.nc = l1;
0N/A this.dataOffset = 5;
0N/A int l2 = apdu[apdu.length - 1] & 0xff;
0N/A this.ne = (l2 == 0) ? 256 : l2;
0N/A return;
0N/A } else {
0N/A throw new IllegalArgumentException
0N/A ("Invalid APDU: length=" + apdu.length + ", b1=" + l1);
0N/A }
0N/A }
0N/A if (apdu.length < 7) {
0N/A throw new IllegalArgumentException
0N/A ("Invalid APDU: length=" + apdu.length + ", b1=" + l1);
0N/A }
0N/A int l2 = ((apdu[5] & 0xff) << 8) | (apdu[6] & 0xff);
0N/A if (apdu.length == 7) {
0N/A // case 2e
0N/A this.ne = (l2 == 0) ? 65536 : l2;
0N/A return;
0N/A }
0N/A if (l2 == 0) {
0N/A throw new IllegalArgumentException("Invalid APDU: length="
0N/A + apdu.length + ", b1=" + l1 + ", b2||b3=" + l2);
0N/A }
0N/A if (apdu.length == 4 + 3 + l2) {
0N/A // case 3e
0N/A this.nc = l2;
0N/A this.dataOffset = 7;
0N/A return;
0N/A } else if (apdu.length == 4 + 5 + l2) {
0N/A // case 4e
0N/A this.nc = l2;
0N/A this.dataOffset = 7;
0N/A int leOfs = apdu.length - 2;
0N/A int l3 = ((apdu[leOfs] & 0xff) << 8) | (apdu[leOfs + 1] & 0xff);
0N/A this.ne = (l3 == 0) ? 65536 : l3;
0N/A } else {
0N/A throw new IllegalArgumentException("Invalid APDU: length="
0N/A + apdu.length + ", b1=" + l1 + ", b2||b3=" + l2);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Constructs a CommandAPDU from the four header bytes, command data,
0N/A * and expected response data length. This is case 4 in ISO 7816,
0N/A * command data and Le present. The value Nc is taken as
0N/A * <code>dataLength</code>.
0N/A * If Ne or Nc
0N/A * are zero, the APDU is encoded as case 1, 2, or 3 per ISO 7816.
0N/A *
0N/A * <p>Note that the data bytes are copied to protect against
0N/A * subsequent modification.
0N/A *
0N/A * @param cla the class byte CLA
0N/A * @param ins the instruction byte INS
0N/A * @param p1 the parameter byte P1
0N/A * @param p2 the parameter byte P2
0N/A * @param data the byte array containing the data bytes of the command body
0N/A * @param dataOffset the offset in the byte array at which the data
0N/A * bytes of the command body begin
0N/A * @param dataLength the number of the data bytes in the command body
0N/A * @param ne the maximum number of expected data bytes in a response APDU
0N/A *
0N/A * @throws NullPointerException if data is null and dataLength is not 0
0N/A * @throws IllegalArgumentException if dataOffset or dataLength are
0N/A * negative or if dataOffset + dataLength are greater than data.length,
0N/A * or if ne is negative or greater than 65536,
0N/A * or if dataLength is greater than 65535
0N/A */
0N/A public CommandAPDU(int cla, int ins, int p1, int p2, byte[] data,
0N/A int dataOffset, int dataLength, int ne) {
0N/A checkArrayBounds(data, dataOffset, dataLength);
0N/A if (dataLength > 65535) {
0N/A throw new IllegalArgumentException("dataLength is too large");
0N/A }
0N/A if (ne < 0) {
0N/A throw new IllegalArgumentException("ne must not be negative");
0N/A }
0N/A if (ne > 65536) {
0N/A throw new IllegalArgumentException("ne is too large");
0N/A }
0N/A this.ne = ne;
0N/A this.nc = dataLength;
0N/A if (dataLength == 0) {
0N/A if (ne == 0) {
0N/A // case 1
0N/A this.apdu = new byte[4];
0N/A setHeader(cla, ins, p1, p2);
0N/A } else {
0N/A // case 2s or 2e
0N/A if (ne <= 256) {
0N/A // case 2s
0N/A // 256 is encoded as 0x00
0N/A byte len = (ne != 256) ? (byte)ne : 0;
0N/A this.apdu = new byte[5];
0N/A setHeader(cla, ins, p1, p2);
0N/A this.apdu[4] = len;
0N/A } else {
0N/A // case 2e
0N/A byte l1, l2;
0N/A // 65536 is encoded as 0x00 0x00
0N/A if (ne == 65536) {
0N/A l1 = 0;
0N/A l2 = 0;
0N/A } else {
0N/A l1 = (byte)(ne >> 8);
0N/A l2 = (byte)ne;
0N/A }
0N/A this.apdu = new byte[7];
0N/A setHeader(cla, ins, p1, p2);
0N/A this.apdu[5] = l1;
0N/A this.apdu[6] = l2;
0N/A }
0N/A }
0N/A } else {
0N/A if (ne == 0) {
0N/A // case 3s or 3e
0N/A if (dataLength <= 255) {
0N/A // case 3s
0N/A apdu = new byte[4 + 1 + dataLength];
0N/A setHeader(cla, ins, p1, p2);
0N/A apdu[4] = (byte)dataLength;
0N/A this.dataOffset = 5;
0N/A System.arraycopy(data, dataOffset, apdu, 5, dataLength);
0N/A } else {
0N/A // case 3e
0N/A apdu = new byte[4 + 3 + dataLength];
0N/A setHeader(cla, ins, p1, p2);
0N/A apdu[4] = 0;
0N/A apdu[5] = (byte)(dataLength >> 8);
0N/A apdu[6] = (byte)dataLength;
0N/A this.dataOffset = 7;
0N/A System.arraycopy(data, dataOffset, apdu, 7, dataLength);
0N/A }
0N/A } else {
0N/A // case 4s or 4e
0N/A if ((dataLength <= 255) && (ne <= 256)) {
0N/A // case 4s
0N/A apdu = new byte[4 + 2 + dataLength];
0N/A setHeader(cla, ins, p1, p2);
0N/A apdu[4] = (byte)dataLength;
0N/A this.dataOffset = 5;
0N/A System.arraycopy(data, dataOffset, apdu, 5, dataLength);
0N/A apdu[apdu.length - 1] = (ne != 256) ? (byte)ne : 0;
0N/A } else {
0N/A // case 4e
0N/A apdu = new byte[4 + 5 + dataLength];
0N/A setHeader(cla, ins, p1, p2);
0N/A apdu[4] = 0;
0N/A apdu[5] = (byte)(dataLength >> 8);
0N/A apdu[6] = (byte)dataLength;
0N/A this.dataOffset = 7;
0N/A System.arraycopy(data, dataOffset, apdu, 7, dataLength);
0N/A if (ne != 65536) {
0N/A int leOfs = apdu.length - 2;
0N/A apdu[leOfs] = (byte)(ne >> 8);
0N/A apdu[leOfs + 1] = (byte)ne;
0N/A } // else le == 65536: no need to fill in, encoded as 0
0N/A }
0N/A }
0N/A }
0N/A }
0N/A
0N/A private void setHeader(int cla, int ins, int p1, int p2) {
0N/A apdu[0] = (byte)cla;
0N/A apdu[1] = (byte)ins;
0N/A apdu[2] = (byte)p1;
0N/A apdu[3] = (byte)p2;
0N/A }
0N/A
0N/A /**
0N/A * Returns the value of the class byte CLA.
0N/A *
0N/A * @return the value of the class byte CLA.
0N/A */
0N/A public int getCLA() {
0N/A return apdu[0] & 0xff;
0N/A }
0N/A
0N/A /**
0N/A * Returns the value of the instruction byte INS.
0N/A *
0N/A * @return the value of the instruction byte INS.
0N/A */
0N/A public int getINS() {
0N/A return apdu[1] & 0xff;
0N/A }
0N/A
0N/A /**
0N/A * Returns the value of the parameter byte P1.
0N/A *
0N/A * @return the value of the parameter byte P1.
0N/A */
0N/A public int getP1() {
0N/A return apdu[2] & 0xff;
0N/A }
0N/A
0N/A /**
0N/A * Returns the value of the parameter byte P2.
0N/A *
0N/A * @return the value of the parameter byte P2.
0N/A */
0N/A public int getP2() {
0N/A return apdu[3] & 0xff;
0N/A }
0N/A
0N/A /**
0N/A * Returns the number of data bytes in the command body (Nc) or 0 if this
0N/A * APDU has no body. This call is equivalent to
0N/A * <code>getData().length</code>.
0N/A *
0N/A * @return the number of data bytes in the command body or 0 if this APDU
0N/A * has no body.
0N/A */
0N/A public int getNc() {
0N/A return nc;
0N/A }
0N/A
0N/A /**
0N/A * Returns a copy of the data bytes in the command body. If this APDU as
0N/A * no body, this method returns a byte array with length zero.
0N/A *
0N/A * @return a copy of the data bytes in the command body or the empty
0N/A * byte array if this APDU has no body.
0N/A */
0N/A public byte[] getData() {
0N/A byte[] data = new byte[nc];
0N/A System.arraycopy(apdu, dataOffset, data, 0, nc);
0N/A return data;
0N/A }
0N/A
0N/A /**
0N/A * Returns the maximum number of expected data bytes in a response
0N/A * APDU (Ne).
0N/A *
0N/A * @return the maximum number of expected data bytes in a response APDU.
0N/A */
0N/A public int getNe() {
0N/A return ne;
0N/A }
0N/A
0N/A /**
0N/A * Returns a copy of the bytes in this APDU.
0N/A *
0N/A * @return a copy of the bytes in this APDU.
0N/A */
0N/A public byte[] getBytes() {
0N/A return apdu.clone();
0N/A }
0N/A
0N/A /**
0N/A * Returns a string representation of this command APDU.
0N/A *
0N/A * @return a String representation of this command APDU.
0N/A */
0N/A public String toString() {
0N/A return "CommmandAPDU: " + apdu.length + " bytes, nc=" + nc + ", ne=" + ne;
0N/A }
0N/A
0N/A /**
0N/A * Compares the specified object with this command APDU for equality.
0N/A * Returns true if the given object is also a CommandAPDU and its bytes are
0N/A * identical to the bytes in this CommandAPDU.
0N/A *
0N/A * @param obj the object to be compared for equality with this command APDU
0N/A * @return true if the specified object is equal to this command APDU
0N/A */
0N/A public boolean equals(Object obj) {
0N/A if (this == obj) {
0N/A return true;
0N/A }
0N/A if (obj instanceof CommandAPDU == false) {
0N/A return false;
0N/A }
0N/A CommandAPDU other = (CommandAPDU)obj;
0N/A return Arrays.equals(this.apdu, other.apdu);
0N/A }
0N/A
0N/A /**
0N/A * Returns the hash code value for this command APDU.
0N/A *
0N/A * @return the hash code value for this command APDU.
0N/A */
0N/A public int hashCode() {
0N/A return Arrays.hashCode(apdu);
0N/A }
0N/A
0N/A private void readObject(java.io.ObjectInputStream in)
0N/A throws java.io.IOException, ClassNotFoundException {
0N/A apdu = (byte[])in.readUnshared();
0N/A // initialize transient fields
0N/A parse();
0N/A }
0N/A
0N/A}