Exports one or more certificates, keys, or identities.
- macOS 10.7+
The keychain item or items to export. You can export only the following types of keychain items:
Sec. If you are exporting exactly one item, you can specify a
Secobject. Otherwise this parameter is a
CFArrayobject containing a number of items of type
A flag field indicating whether the exported item should have PEM armor. PEM armor refers to a way of expressing binary data as an ASCII string so that it can be transferred over text-only channels such as email. Set this flag to
pemif you want PEM armoring.
A pointer to a structure containing a set of input parameters for the function. If no key items are being exported, these parameters are optional and you can set the
NULL. For more information, see
Item Import Export Key Parameters
A result code. See Security Framework Result Codes.
This function works only with keys, certificates, and identities. An identity is the combination of a certificate and its associated private key. Although public keys are commonly stored in certificates, they can be stored separately in the keychain as well; for example, when you call the
Sec function to create a key pair, both the public and private keys are stored in the keychain. Use the
Sec function to find a key or certificate. Use the
Sec function in the Certificate, Key, and Trust API to find an identity.