CardType
public protocol CardType
General card representation
-
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 implementationDefault 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 implementationProvide 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
Declaration
Swift
func disconnect(reset: Bool) throws
Parameters
reset
true to reset the Card after disconnecting.