Revert "Add capabilities."

This reverts commit bfa7a3cd51.
This commit is contained in:
Max Goedjen 2025-08-23 20:07:05 -07:00
parent 47ed2135f1
commit b772dca2ab
No known key found for this signature in database
2 changed files with 1 additions and 14 deletions

View File

@ -12,12 +12,6 @@ extension SmartCard {
public let keySize: Int
public let requiresAuthentication: Bool = false
public let publicKey: Data
public let capabilities: Set<KeyCapabilities>
public enum KeyCapabilities: Sendable {
case signature
case encryption
}
}

View File

@ -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<SmartCard.Secret.KeyCapabilities> = []
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)
}