From b772dca2ab738c214074adcb744fd88d30e21d35 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 23 Aug 2025 20:07:05 -0700 Subject: [PATCH] Revert "Add capabilities." This reverts commit bfa7a3cd51f15ba449b77f5a1320a43aa491d05a. --- .../Sources/SmartCardSecretKit/SmartCardSecret.swift | 6 ------ .../Sources/SmartCardSecretKit/SmartCardStore.swift | 9 +-------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Sources/Packages/Sources/SmartCardSecretKit/SmartCardSecret.swift b/Sources/Packages/Sources/SmartCardSecretKit/SmartCardSecret.swift index bfa7420..348926f 100644 --- a/Sources/Packages/Sources/SmartCardSecretKit/SmartCardSecret.swift +++ b/Sources/Packages/Sources/SmartCardSecretKit/SmartCardSecret.swift @@ -12,12 +12,6 @@ extension SmartCard { public let keySize: Int public let requiresAuthentication: Bool = false public let publicKey: Data - public let capabilities: Set - - public enum KeyCapabilities: Sendable { - case signature - case encryption - } } diff --git a/Sources/Packages/Sources/SmartCardSecretKit/SmartCardStore.swift b/Sources/Packages/Sources/SmartCardSecretKit/SmartCardStore.swift index 4d8f42c..d52c1c8 100644 --- a/Sources/Packages/Sources/SmartCardSecretKit/SmartCardStore.swift +++ b/Sources/Packages/Sources/SmartCardSecretKit/SmartCardStore.swift @@ -170,14 +170,7 @@ extension SmartCard.Store { let publicKeySecRef = SecKeyCopyPublicKey(publicKeyRef)! let publicKeyAttributes = SecKeyCopyAttributes(publicKeySecRef) as! [CFString: Any] let publicKey = publicKeyAttributes[kSecValueData] as! Data - var capabilities: Set = [] - if ($0[kSecAttrCanSign] as? Bool) == true { - capabilities.insert(.signature) - } - if ($0[kSecAttrCanEncrypt] as? Bool) == true && ($0[kSecAttrCanDecrypt] as? Bool) == true { - capabilities.insert(.encryption) - } - return SmartCard.Secret(id: tokenID, name: name, algorithm: algorithm, keySize: keySize, publicKey: publicKey, capabilities: capabilities) + return SmartCard.Secret(id: tokenID, name: name, algorithm: algorithm, keySize: keySize, publicKey: publicKey) } state.secrets.append(contentsOf: wrapped) }