Skip to main content

Session Storage

This guide covers securely storing and restoring Privacy Boost sessions using iOS Keychain, expanding on the persistence options in Key Management.

Why Keychain?

Session data includes sensitive cryptographic keys. Keychain provides:
  • Hardware-backed encryption
  • Access control (biometrics, passcode)
  • Secure enclave support
  • Data protection across app updates

Basic Keychain Wrapper

Create a Keychain helper:

Session Storage

Store and retrieve Privacy Boost sessions:

Biometric Protection

Add Face ID/Touch ID protection:

Usage in App

Integrate with your SDK manager:

Security Best Practices

  1. Use kSecAttrAccessibleWhenUnlockedThisDeviceOnly - Data only accessible when device is unlocked
  2. Enable biometrics - Add Face ID/Touch ID for sensitive operations
  3. Don’t store in UserDefaults - UserDefaults is not encrypted
  4. Clear on logout - Delete Keychain items when user logs out
  5. Handle errors gracefully - Don’t expose Keychain errors to users

Info.plist

Add Face ID usage description:

Next Steps