ios-securitylisted
Install: claude install-skill dpearson2699/swift-ios-skills
# iOS Security
Guidance for handling sensitive data, authenticating users, encrypting
correctly, and following Apple's security best practices on iOS.
## Contents
- [Keychain Services](#keychain-services)
- [Data Protection](#data-protection)
- [CryptoKit](#cryptokit)
- [Secure Enclave](#secure-enclave)
- [Biometric Authentication](#biometric-authentication)
- [App Transport Security (ATS)](#app-transport-security-ats)
- [Certificate Pinning](#certificate-pinning)
- [Secure Coding Patterns](#secure-coding-patterns)
- [Privacy Manifests](#privacy-manifests)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)
## Keychain Services
The Keychain is the ONLY correct place to store sensitive data. Never store
passwords, tokens, API keys, or secrets in UserDefaults, files, or Core Data.
### Storing Credentials
```swift
func saveToKeychain(account: String, data: Data, service: String) throws {
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: account,
kSecAttrService as String: service,
kSecValueData as String: data,
kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
]
let status = SecItemAdd(query as CFDictionary, nil)
if status == errSecDuplicateItem {
let updateQuery: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as Str