I am working on a project that allows access to certificates from a cryptographic card that supports communication via NFC with the mobile device. At this point, I am able to read the data from the card (public certificate and root certificate) and am able to send data (a hash) to the card and have it sign it with the private certificate. On the other hand, with the following code I can validate a user while browsing using a webview when the server needs authentication with a digital certificate. func sendClientCertificate(for challenge: URLAuthenticationChallenge, via completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { guard let data = try? Data(contentsOf: URL(fileURLWithPath: certificado!)), let credential = credential(from: data, withPassword: password ?? ) else { challenge.sender?.cancel(challenge) return completionHandler(.rejectProtectionSpace, .none) } return completionHandler(.useCredential, credential); } func credential(from data: Data, withPass
1
0
967