Card

@objcMembers
public class Card : BaseClass

SmartCardIO - Card class

A Smart Card with which a connection has been established. Card objects are obtained by calling CardTerminal.connect().

  • Possible connection protocol used for Card connections

    See more

    Declaration

    Swift

    public enum ConnectionProtocol : String, Equatable, CaseNameable
  • Requests exclusive access to this card. Once a thread has invoked beginExclusive, only this thread is allowed to communicate with this card until it calls endExclusive. Other threads attempting communication will receive a CardException. Applications have to ensure that exclusive access is correctly released. This can be achieved by executing the beginExclusive() and endExclusive calls.

    Throws

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

    Declaration

    Swift

    public func beginExclusive() throws
  • Releases the exclusive access previously established using beginExclusive.

    Throws

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

    Declaration

    Swift

    public func endExclusive() throws
  • Returns the ATR of this card.

    Declaration

    Swift

    public func getATR() -> ATR

    Return Value

    ATR in the form of a ATR object

  • Returns the CardChannel for the basic logical channel. The basic logical channel has a channel number of 0.

    Throws

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

    Declaration

    Swift

    public func getBasicChannel() throws -> CardChannel

    Return Value

    CardChannel in the form of a CardChannel object

  • Returns the protocol in use for this card.

    Declaration

    Swift

    public func getProtocol() -> ConnectionProtocol

    Return Value

    Connection protocol (see enum ConnectionProtocol for possible values)

  • Returns the protocol in use for this card in String form.

    Declaration

    Swift

    public func getProtocol() -> String

    Return Value

    Connection protocol as String

  • Opens a new logical channel to the card and returns it. The channel is opened by issuing a MANAGE CHANNEL command that should use the format [00 70 00 00 01].

    Throws

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

    Declaration

    Swift

    public func openLogicalChannel() throws -> CardChannel

    Return Value

    CardChannel in the form of a CardChannel object

  • Transmits a control command to the terminal device. This can be used to, for example, control terminal functions like a built-in PIN pad or biometrics.

    Throws

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

    Declaration

    Swift

    public func transmitControlCommand(controlCode: Int, command: Data) throws -> Data?

    Parameters

    controlCode

    The control code of the command. Note: only code 3500 is supported as this time.

    command

    The command Data

    Return Value

    Response data if any, else nil

  • Disconnects the connection with this card. After this method returns, calling methods on this object or in CardChannels associated with this object that require interaction with the card will raise an error.

    Throws

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

    Declaration

    Swift

    public func disconnect(reset: Bool) throws

    Parameters

    reset

    whether to reset the card after disconnecting.