I have an iOS/iPadOS app and 'm trying to communicate with usb smart card reader using CryptoTokenKit on all platforms (ios/ipados/macos).
Minimal Repro Code
import CryptoTokenKit
import SwiftUI
struct ContentView: View {
@State var status = ""
var body: some View {
VStack {
Text("Status: \(status)")
}
.padding()
.onAppear {
let manager = TKSmartCardSlotManager.default
if manager != nil {
status = "Initialized"
} else {
status = "Unsupported"
}
}
}
}
And my entitlement file has only one key: com.apple.security.smartcard = YES
Behavior
• iPadOS (on device): status = "Initialized" ✅
• macOS (native macOS app, with the required CryptoTokenKit entitlement): status = "Initialized" ✅
• macOS (Designed for iPad, regardless of CryptoTokenKit entitlement): status = "Unsupported" → TKSmartCardSlotManager.default is nil ❌
Expectation
Given that the same iPadOS build initializes TKSmartCardSlotManager, I expected the iPad app running in Designed for iPad mode on Apple silicon Mac to behave the same (or to have a documented limitation).
Questions
-
Is CryptoTokenKit (and specifically TKSmartCardSlotManager) supported for iPad apps running on Mac in Designed for iPad mode?
-
If support exists, what entitlements / capabilities are required for USB smart-card access in this configuration?
-
If not supported, is Mac Catalyst the correct/only path on macOS to access USB smart-card readers via CryptoTokenKit?
-
Are there recommended alternatives for iPad apps on Mac (Designed for iPad) to communicate with USB smart-card readers (e.g., ExternalAccessory, DriverKit, etc.), or is this scenario intentionally unsupported?
Thanks!