Saving and loading client certificate on iOS

676 Views Asked by At

I'm new in iOS development and actually I'm using Xamarin for iOS but documentation regading certificate management in Xamarin.iOS is poor. So ObjC answer will be fine.

My task is to receive certificate from server, save it permanently to keychain and then use it for authentication.

So at the moment I do:

  1. Receive certificate from server as byte array.
  2. SecPKCS12Import
  3. SecItemAdd

And when I need certificate I do execute SecItemCopyMatching and find certificate using Label.

Is that a right approach? The problem is that when I try to get identity using same Label from the keychain I get errSecParam error.

Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

Problem was in this Xamarin iOS issue https://bugzilla.xamarin.com/show_bug.cgi?id=24972