Skip to content

Implementation of X509 certificate APIs on iOS #49289

@filipnavara

Description

@filipnavara

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 as AppleCryptoNative_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions