macossslsecure-transport

OS X how to check certificate is signature


Is there a way to check a certificate is signed by a given root certificate using SecureTransport API similar to OpenSSL X509_verify?


Solution

  • On OS X, the API to create and manipulate certificates is the Certificate, Key, and Trust Services:

    Certificate, Key, and Trust Services is a C API for managing certificates, public and private keys, symmetric keys, and trust policies in iOS and OS X. You can use these services in your app to:

    • Create certificates and asymmetric keys
    • Add certificates and keys to keychains, remove them from keychains, and use keys to encrypt and decrypt data
    • Retrieve information about a certificate, such as the private key associated with it, the owner, and so on
    • Convert certificates to and from portable representations
    • Create and manipulate trust policies and evaluate a specific certificate using a specified set of trust policies
    • Add anchor certificates

    See for example: