CardChannel

public class CardChannel : BaseClass

SmartCardIO - CardChannel class

A logical channel connection to a Smart Card. It is used to exchange APDUs with a Smart Card. A CardChannel object can be obtained by calling the method Card.getBasicChannel() or Card.openLogicalChannel().

  • Closes this CardChannel

    Throws

    Status.StatusCode on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func close() throws
  • Returns the Card this channel is associated with.

    Declaration

    Swift

    public func getCard() -> Card

    Return Value

    Associated Card object

  • Returns the channel number of this CardChannel (0 for default channel).

    Declaration

    Swift

    public func getChannelNumber() -> Int

    Return Value

    Channel number as Int

  • Transmits the specified command APDU to the Smart Card and returns the response APDU.

    Throws

    Status.StatusCode on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func transmit(command: CommandAPDU) throws -> ResponseAPDU

    Parameters

    command

    Command in the form of a CommandAPDU

    Return Value

    A response in the form of a ResponseAPDU

  • Transmits the command APDU stored in the command Data buffer and receives the reponse APDU in the response Data buffer.

    Throws

    Status.StatusCode on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func transmit(command: Data, response: inout Data) throws -> Int

    Parameters

    command

    Command APDU in the form of a Data buffer

    response

    Response APDU in the form of a Data buffer

    Return Value

    Number of response bytes on success