CardType

public protocol CardType

General card representation

  • atr

    Card Answer-to-reset configuration

    Declaration

    Swift

    var atr: ATR { get }
  • Card supported protocol(s)

    Declaration

    Swift

    var `protocol`: CardProtocol { get }
  • Open a communication channel to the Card.

    Note

    the basic channel assumes the channel number 0.

    Throws

    CardError when failed to connect to the Card.

    Declaration

    Swift

    func openBasicChannel() throws -> CardChannelType

    Return Value

    The (connected) card channel

  • Open a new logical channel. The channel is opened issuing a MANAGE CHANNEL command that should use the format [0x0, 0x70, 0x0, 0x0, 0x1].

    Throws

    CardError when failed to connect to the Card.

    Declaration

    Swift

    func openLogicChannel() throws -> CardChannelType

    Return Value

    The (connected) card channel

  • transmitControl(command:data:) Default implementation

    Transmit a control command to the Card/Slot

    Note

    implementation is optional.

    Throws

    CardError

    Default Implementation

    Default implementation returns empty data object.

    Declaration

    Swift

    func transmitControl(command: Int, data: Data) throws -> Data

    Return Value

    The returned Data upon success.

  • initialApplicationIdentifier() Default implementation

    Provide an initial application identifier of an application on the underlying card (f.e. the root application).

    Throws

    Error when requesting the application identifier or parsing it.

    Default Implementation

    Default implementation returns nil.

    Declaration

    Swift

    func initialApplicationIdentifier() throws -> Data?

    Return Value

    The initial application identifier if known, else nil.

  • Disconnect connection to the Card.

    Throws

    CardError

    Declaration

    Swift

    func disconnect(reset: Bool) throws

    Parameters

    reset

    true to reset the Card after disconnecting.