Class CommandAPDU

  • Direct Known Subclasses:
    IsoCommandAPDU

    public class CommandAPDU
    extends APDU
    Represents a command APDU that can be modified.
    Author:
    Thomas Schaeck (schaeck@de.ibm.com), Roland Weber (rolweber@de.ibm.com), Mike Wendler (mwendler@de.ibm.com)
    • Constructor Detail

      • CommandAPDU

        public CommandAPDU​(byte[] buffer)
        Creates a command APDU and initializes it with the given buffer. The internal buffer's length is set to the length of the buffer passed. The APDU buffer is explicitly cleared during garbage collection to prevent leakage of sensitive data. An APDU can not be used multiple times.
        Parameters:
        buffer - the byte array to be used for holding the APDU
        See Also:
        APDU.getLength()
      • CommandAPDU

        public CommandAPDU​(byte[] buffer,
                           int length)
                    throws java.lang.IndexOutOfBoundsException
        Creates a new command APDU and initializes it with the given buffer. The buffer is assumed to hold an APDU. The length of the internally buffered APDU is set to length. The APDU buffer is explicitly cleared during garbage collection to prevent leakage of sensitive data. An APDU can not be used multiple times.
        Parameters:
        buffer - the byte array to be used for holding the APDU
        length - the length of the APDU currently in the buffer
        Throws:
        java.lang.IndexOutOfBoundsException - length exceeds the size of the array bytes.
        See Also:
        APDU.getLength()
      • CommandAPDU

        public CommandAPDU​(int size)
        Creates a new command APDU with a given buffer size. A new buffer with the given size is allocated. The length of the internally buffered APDU is set to 0. The APDU buffer is explicitly cleared during garbage collection to prevent leakage of sensitive data. An APDU can not be used multiple times.
        Parameters:
        size - the size of the buffer to create
        See Also:
        APDU.getLength()
    • Method Detail

      • setQueueable

        public void setQueueable​(boolean queueable)
        Mark that this APDU can be combined with the subsequent APDU for asynchronous transmission. This has only an effect, if the CardTerminal support this feature.
        Parameters:
        queueable - true if this APDU is queueable
      • isQueueable

        public boolean isQueueable()