-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Issues #47533 and #47910 track APIs that are missing from Apple Crypto interop on iOS. When I started removing the managed part of the Interop APIs from iOS build of System.Security.Cryptography.X509Certificates I realised I'd basically end up with a useless assembly that throws PlatformNotSupportedException for everything. The underlying reason is that iOS doesn't have the macOS keychain API and even the most basic X509 manipulation relies on a working export which is implemented through this API and hence not available. To make it at least marginally working the following things probably need to be done:
- Export certificates through
SecCertificateCopyData
API and expose it asAppleCryptoNative_X509GetRawData
- Import certificates through
SecCertificateCreateWithData
/SecPKCS12Import
API instead of temporary keychains
This should probably be analysed by someone who is more familiar with the API surface on the Apple side. It also looks like enumerating any certificate store, including the trusted root certificates, seems impossible on iOS.