diff --git a/SecretKit/SmartCard/SmartCardStore.swift b/SecretKit/SmartCard/SmartCardStore.swift index da243c6..7e65c5f 100644 --- a/SecretKit/SmartCard/SmartCardStore.swift +++ b/SecretKit/SmartCard/SmartCardStore.swift @@ -2,6 +2,8 @@ import Foundation import Security import CryptoTokenKit +// TODO: Might need to split this up into "sub-stores?" +// ie, each token has its own Store. extension SmartCard { public class Store: SecretStore { @@ -13,7 +15,12 @@ extension SmartCard { public init() { watcher.setInsertionHandler { (string) in - print(string) + guard !string.contains("setoken") else { return } + let driver = TKSmartCardTokenDriver() + let token = TKToken(tokenDriver: driver, instanceID: string) + let session = TKSmartCardTo kenSession(token: token) + print(session) + } print(watcher.tokenIDs) } diff --git a/Secretive/AppDelegate.swift b/Secretive/AppDelegate.swift index ee03f86..420f4ae 100644 --- a/Secretive/AppDelegate.swift +++ b/Secretive/AppDelegate.swift @@ -12,7 +12,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { - let contentView = ContentView(store: secureEnclave) + let contentView = ContentView(store: yubikey) // Create the window and set the content view. window = NSWindow( contentRect: NSRect(x: 0, y: 0, width: 480, height: 300), diff --git a/Secretive/Secretive.entitlements b/Secretive/Secretive.entitlements index 7f8f6ca..56b1906 100644 --- a/Secretive/Secretive.entitlements +++ b/Secretive/Secretive.entitlements @@ -3,7 +3,7 @@ com.apple.security.app-sandbox - + keychain-access-groups $(AppIdentifierPrefix)com.maxgoedjen.Secretive