This commit is contained in:
Max Goedjen 2025-08-23 19:40:27 -07:00
parent bfa7a3cd51
commit 7c5c2924fa
No known key found for this signature in database

View File

@ -66,6 +66,9 @@ extension SmartCard {
public func sign(data: Data, with secret: Secret, for provenance: SigningRequestProvenance) async throws -> Data { public func sign(data: Data, with secret: Secret, for provenance: SigningRequestProvenance) async throws -> Data {
guard let tokenID = await state.tokenID else { fatalError() } guard let tokenID = await state.tokenID else { fatalError() }
guard secret.capabilities.contains(.signature) else {
throw SigningError(error: nil)
}
let context = LAContext() let context = LAContext()
context.localizedReason = String(localized: .authContextRequestSignatureDescription(appName: provenance.origin.displayName, secretName: secret.name)) context.localizedReason = String(localized: .authContextRequestSignatureDescription(appName: provenance.origin.displayName, secretName: secret.name))
context.localizedCancelTitle = String(localized: .authContextRequestDenyButton) context.localizedCancelTitle = String(localized: .authContextRequestDenyButton)