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 the image below, 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.
[Image]
Topics
Essentials
Authorization and authentication
Password AutoFillShared Web CredentialsAuthorization ServicesAuthorization Plug-insSessionsOne-time codes
Secure data
Secure code
Code Signing ServicesNotarizing macOS software before distributionPreparing your app to work with pointer authenticationApp SandboxHardened RuntimeDisabling and Enabling System Integrity ProtectionUsing the latest code signature formatUpdating Mac SoftwareTN3125: Inside Code Signing: Provisioning Profiles
Launch environment constraints
Applying launch environment and library constraintsDefining launch environment and library constraintsConstraining a tool’s launch environment
Cryptography
Complying with Encryption Export RegulationsCertificate, Key, and Trust ServicesCryptographic Message Syntax ServicesRandomization ServicesSecurity TransformsASN.1
Result codes
Legacy interfaces
Reference
Variables
CSSM_APPLE_PRIVATE_CSPDL_CODE_28TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256errSecCSDetachedCertificateserrSecCSMultipleSelfSigningerrSecCSRemoteSignerFirstSlotFullerrSecCSRemoteSignerSecondSlotFullerrSecCSUnsupportedAlgorithmerrSecMissingQualifiedCertStatementkSecCFErrorDetachedCertificateskSecCS_MAX_SIGNATURESkSecCodeInfoChosenSignaturekSecCodeInfoSignerInfoSKIDkSecCodeInfoTotalSignatureskSecPolicyAppleEAPClientkSecPolicyAppleEAPServerkSecPolicyAppleIPSecClientkSecPolicyAppleIPSecServerkSecPolicyAppleSSLClientkSecPolicyAppleSSLServerkSecTrustQCStatementskSecTrustQWACValidation
Functions
SecIdentityCreate(_:_:_:)sec_protocol_metadata_copy_negotiated_protocol(_:)sec_protocol_metadata_copy_server_name(_:)