Forum Xamarin.Mac

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Import P12/PFX into keychain and mark it as non-exportable

achuchevachuchev Member
edited March 2019 in Xamarin.Mac

I'm able to import certificate with private key(p12) into the keychain using
... var options = NSDictionary.FromObjectAndKey(NSObject.FromObject(Password),SecImportExport.Passphrase); NSDictionary[] result; SecStatusCode statusCode = SecImportExport.ImportPkcs12(pfx, options, out result); ...
Unfortunately, I don't see a way to mark it as non-exportable. Any idea how to achieve it?

This option is available using "security import -x" from command line
security import -h Usage: import inputfile [-k keychain] [-t type] [-f format] [-w] [-P passphrase] [options…] -x Specify that private keys are non-extractable after being imported

Tagged:
Sign In or Register to comment.