<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecExternalFormat",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@E@SecExternalFormat"
  },
  "title" : "SecExternalFormat"
}
-->

# SecExternalFormat

The external format of a keychain item.

```
enum SecExternalFormat
```

## Topics

### Constants

[`SecExternalFormat.formatUnknown`](/documentation/Security/SecExternalFormat/formatUnknown)

[`SecExternalFormat.formatOpenSSL`](/documentation/Security/SecExternalFormat/formatOpenSSL)

Format for asymmetric (public/private) keys. OpenSSL is an open source toolkit for Secure Sockets Layer (SSL) and Transport Layer Security (TLS). Also known as X.509 for public keys.

[`SecExternalFormat.formatSSH`](/documentation/Security/SecExternalFormat/formatSSH)

OpenSSH 1 format for asymmetric (public/private) keys. OpenSSH is an OpenBSD implementation of the Secure Shell (SSH) protocol.

[`SecExternalFormat.formatBSAFE`](/documentation/Security/SecExternalFormat/formatBSAFE)

Format for asymmetric keys. BSAFE is a standard from RSA Security for encryption, digital signatures, and privacy.

[`SecExternalFormat.formatSSHv2`](/documentation/Security/SecExternalFormat/formatSSHv2)

OpenSSH 2 format for public keys. OpenSSH version 2 private keys are in format `kSecFormatOpenSSL` or `kSecFormatWrappedOpenSSL`. OpenSSH is an OpenBSD implementation of the Secure Shell (SSH) protocol.

[`SecExternalFormat.formatRawKey`](/documentation/Security/SecExternalFormat/formatRawKey)

Format for symmetric keys. Raw, unformatted key bits. This is the default for symmetric keys.

[`SecExternalFormat.formatWrappedPKCS8`](/documentation/Security/SecExternalFormat/formatWrappedPKCS8)

Format for wrapped symmetric and private keys. PKCS8 is the Private-Key Information Syntax Standard from RSA Security.

[`SecExternalFormat.formatWrappedOpenSSL`](/documentation/Security/SecExternalFormat/formatWrappedOpenSSL)

Format for wrapped symmetric and private keys. OpenSSL is an open-source toolkit for Secure Sockets Layer (SSL) and Transport Layer Security (TLS).

[`SecExternalFormat.formatWrappedSSH`](/documentation/Security/SecExternalFormat/formatWrappedSSH)

OpenSSH 1 format for wrapped symmetric and private keys.  OpenSSH is an OpenBSD implementation of the Secure Shell (SSH) protocol.

[`SecExternalFormat.formatWrappedLSH`](/documentation/Security/SecExternalFormat/formatWrappedLSH)

Not supported.

[`SecExternalFormat.formatX509Cert`](/documentation/Security/SecExternalFormat/formatX509Cert)

Format for certificates. DER (distinguished encoding rules) encoded. X.509 is a standard for digital certificates from the International Telecommunication Union (ITU). This is the default for certificates.

[`SecExternalFormat.formatPEMSequence`](/documentation/Security/SecExternalFormat/formatPEMSequence)

Sequence of certificates and keys with 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. This is the default format for multiple items.

[`SecExternalFormat.formatPKCS7`](/documentation/Security/SecExternalFormat/formatPKCS7)

Sequence of certificates, no PEM armor. PKCS7 is the Cryptographic Message Syntax Standard from RSA Security, Inc.

[`SecExternalFormat.formatPKCS12`](/documentation/Security/SecExternalFormat/formatPKCS12)

Set of certificates and private keys. PKCS12 is the Personal Information Exchange Syntax from RSA Security, Inc.

[`SecExternalFormat.formatNetscapeCertSequence`](/documentation/Security/SecExternalFormat/formatNetscapeCertSequence)

Set of certificates in the Netscape Certificate Sequence format.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)