Framework

Security

Secure the data your app manages, and control access to your app.

Overview

Use the Security framework to protect information, establish trust, and control access to software. Broadly, security services support these goals:

  • Establish a user’s identity (authentication) and then selectively grant access to resources (authorization).

  • Secure data, both on disk and in motion across a network connection.

  • Ensure the validity of code to be executed for a particular purpose.

As shown in Figure 1, you can also use lower level cryptographic resources to create new secure services. Cryptography is difficult and the cost of bugs typically so high that it's rarely a good idea to implement your own cryptography solution. Rely on the Security framework when you need cryptography in your app.

Figure 1

Tools to enable secure interaction with users, data, and code

Diagram showing your app sitting above the Security framework.

Topics

Authorization and Authentication

Shared Web Credentials

Share credentials between iOS apps and their website counterparts.

Authorization Services

Access restricted areas of the operating system, and control access to particular features of your macOS app.

Authorization Plug-ins

Extend the authorization services API by creating plug-ins that can participate in authorization decisions.

Sessions

Manage login, authorization, and security sessions in macOS.

Secure Data

Keychain Services

Securely store small chunks of data on behalf of the user.

Secure Transport

Secure network communication using standardized transport layer security mechanisms.

Code Signing

Code Signing Services

Examine and validate signed code running on the system.

Cryptography

Certificate, Key, and Trust Services

Establish trust using certificates and cryptographic keys.

Cryptographic Message Syntax Services

Cryptographically sign and encrypt S/MIME messages.

Randomization Services

Generate cryptographically secure random numbers.

Security Transforms

Perform cryptographic functions like encoding, encryption, signing, and signature verification.

ASN.1

Encode and decode Distinguished Encoding Rules (DER) and Basic Encoding Rules (BER) data streams.

Result Codes

Security Framework Result Codes

Evaluate result codes common to many Security framework functions.

Legacy Interfaces

Common Security Services Manager

A set of open source modules underpinning the legacy implementation of the Security framework.