One Logo Pool Ball
CryptoTokenKit · IOS API REFERENCE

TKSmartCard

class · iOS 9.0+ · SDK 27.1

class TKSmartCard

Members (24)

method · iOS 9.0+

beginSession

TypeScript
beginSession(reply: ((arg0: boolean, arg1: (NativeError) | null) => void)): void
Swift declaration
func beginSession() async throws -> Bool
method · iOS 9.0+

endSession

TypeScript
endSession(): void
Swift declaration
func endSession()
init

init

TypeScript
static init(): TKSmartCard
Swift declaration
init()
method · iOS 9.0+

transmit

TypeScript
transmit(request: ArrayBuffer, reply: ((arg0: (ArrayBuffer) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func transmit(_ request: Data) async throws -> Data
method · iOS 9.0+

userInteractionForSecurePINChange

TypeScript
userInteractionForSecurePINChange(PINFormat: TKSmartCardPINFormat, APDU: ArrayBuffer, currentPINByteOffset: number, newPINByteOffset: number): (TKSmartCardUserInteractionForSecurePINChange) | null
Swift declaration
func userInteractionForSecurePINChange(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, currentPINByteOffset: Int, newPINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINChange?
method · iOS 9.0+

userInteractionForSecurePINVerification

TypeScript
userInteractionForSecurePINVerification(PINFormat: TKSmartCardPINFormat, APDU: ArrayBuffer, PINByteOffset: number): (TKSmartCardUserInteractionForSecurePINVerification) | null
Swift declaration
func userInteractionForSecurePINVerification(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, pinByteOffset PINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINVerification?
get · iOS 9.0+

allowedProtocols

TypeScript
get allowedProtocols(): TKSmartCardProtocol
Swift declaration
var allowedProtocols: TKSmartCardProtocol { get set }
set · iOS 9.0+

allowedProtocols

TypeScript
set allowedProtocols(value: TKSmartCardProtocol)
Swift declaration
var allowedProtocols: TKSmartCardProtocol { get set }
get · iOS 9.0+

cla

TypeScript
get cla(): number
Swift declaration
var cla: UInt8 { get set }
set · iOS 9.0+

cla

TypeScript
set cla(value: number)
Swift declaration
var cla: UInt8 { get set }
get · iOS 9.0+

context

TypeScript
get context(): (unknown) | null
Swift declaration
var context: Any? { get set }
set · iOS 9.0+

context

TypeScript
set context(value: (unknown) | null)
Swift declaration
var context: Any? { get set }
get · iOS 9.0+

currentProtocol

TypeScript
get currentProtocol(): TKSmartCardProtocol
Swift declaration
var currentProtocol: TKSmartCardProtocol { get }
get · iOS 9.0+

isSensitive

TypeScript
get isSensitive(): boolean
Swift declaration
var isSensitive: Bool { get set }
set · iOS 9.0+

isSensitive

TypeScript
set isSensitive(value: boolean)
Swift declaration
var isSensitive: Bool { get set }
get · iOS 9.0+

slot

TypeScript
get slot(): TKSmartCardSlot
Swift declaration
var slot: TKSmartCardSlot { get }
get · iOS 10.0+

useCommandChaining

TypeScript
get useCommandChaining(): boolean
Swift declaration
var useCommandChaining: Bool { get set }
set · iOS 10.0+

useCommandChaining

TypeScript
set useCommandChaining(value: boolean)
Swift declaration
var useCommandChaining: Bool { get set }
get · iOS 9.0+

useExtendedLength

TypeScript
get useExtendedLength(): boolean
Swift declaration
var useExtendedLength: Bool { get set }
set · iOS 9.0+

useExtendedLength

TypeScript
set useExtendedLength(value: boolean)
Swift declaration
var useExtendedLength: Bool { get set }
get · iOS 9.0+

isValid

TypeScript
get isValid(): boolean
Swift declaration
var isValid: Bool { get }
method · iOS 9.0+

send

TypeScript
sendInsP1P2DataLeReply(ins: number, p1: number, p2: number, data: (ArrayBuffer) | null, le: (number) | null, reply: ((arg0: (ArrayBuffer) | null, arg1: number, arg2: (NativeError) | null) => void)): void
Swift declaration
func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil, reply: @escaping (Data?, UInt16, (any Error)?) -> Void)
method · iOS 10.0+

send

TypeScript
sendInsP1P2DataLe(ins: number, p1: number, p2: number, data?: (ArrayBuffer) | null, le?: (number) | null): { "sw": number; "response": ArrayBuffer }
Swift declaration
func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) throws -> (sw: UInt16, response: Data)

Synchronously sends an APDU command to the smart card. Use this method when you need synchronous execution, such as within `withSession` blocks or when calling from synchronous code paths. - Parameters: - ins: Instruction byte of the APDU command. - p1: P1 parameter byte. - p2: P2 parameter byte. - data: Optional command data. - le: Optional expected response length. - Returns: A tuple containing the status word (sw) and response data. - Throws: An error if the command fails.

method · iOS 13.0+

send

TypeScript
sendInsP1P2DataLe45476(ins: number, p1: number, p2: number, data?: (ArrayBuffer) | null, le?: (number) | null): Promise<{ "sw": number; "response": ArrayBuffer }>
Swift declaration
@backDeployed(before: macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0)
final func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) async throws -> (sw: UInt16, response: Data)

Asynchronously sends an APDU command to the smart card. In an async context, Swift prefers this overload over the synchronous `send(ins:p1:p2:data:le:) throws` method. To call the synchronous overload from an async context, use a typed function reference cast: `card.send as (UInt8, UInt8, UInt8, Data?, Int?) throws -> (UInt16, Data)` - Parameters: - ins: Instruction byte of the APDU command. - p1: P1 parameter byte. - p2: P2 parameter byte. - data: Optional command data. - le: Optional expected response length. - Returns: A tuple containing the status word (sw) and response data. - Throws: `CancellationError` if the task was cancelled before transmission, or an error if the command fails.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

TKSmartCard.withSession(_:)

synchronous callback requires a nonescaping JS-thread call

All CryptoTokenKit types →