ios – NSURLSession client side authentication – choose certificate out of list


I’m using NSURLSession to sent https requests to server. some connections require client side authentication, So I’ve implemented the following method

- (void)URLSession:(NSURLSession*)session
   didReceiveChallenge:(NSURLAuthenticationChallenge*)challenge
     completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition,
                                 NSURLCredential* credential))completionHandler {
  if (challenge.protectionSpace.authenticationMethod ==
      NSURLAuthenticationMethodClientCertificate) {
...

Than I call the following method to get the identity our of the server list of accepted issuers:

status = SecItemCopyMatching(dict, (CFTypeRef*)&identityRef);

Than I get a certificate out this identity.

status = SecIdentityCopyCertificate((SecIdentityRef)identityRef, &certRef);

However, if the there’s more than one matching certificate so I want to be able to trigger a popup window (like this Windows example), so that the user can choose from :

enter image description here

How can I display each certificate represented by a subset of selected fields in a popup using objective-c/swift?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img