OathKeychainSecurityOptions

public struct OathKeychainSecurityOptions : Sendable

Security options for OATH keychain storage. Provides enhanced security configurations including biometric authentication.

Properties

  • Keychain accessibility level.

    Declaration

    Swift

    public let accessibility: String
  • Whether biometric authentication is required.

    Declaration

    Swift

    public let requireBiometrics: Bool
  • Whether device passcode is required as fallback.

    Declaration

    Swift

    public let requireDevicePasscode: Bool
  • Custom prompt for biometric authentication.

    Declaration

    Swift

    public let biometricPrompt: String?
  • Keychain access group for app groups sharing.

    Declaration

    Swift

    public let accessGroup: String?

Initializers

  • Creates security options with specified parameters.

    Declaration

    Swift

    public init(
        accessibility: CFString = kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
        requireBiometrics: Bool = false,
        requireDevicePasscode: Bool = false,
        biometricPrompt: String? = nil,
        accessGroup: String? = nil
    )

    Parameters

    accessibility

    Keychain accessibility level.

    requireBiometrics

    Whether biometric authentication is required.

    requireDevicePasscode

    Whether device passcode is required as fallback.

    biometricPrompt

    Custom prompt for biometric authentication.

    accessGroup

    Keychain access group for sharing.

Predefined Configurations

  • Default security configuration with device unlock protection.

    Declaration

    Swift

    public static let standard: OathKeychainSecurityOptions
  • High security configuration requiring biometric authentication.

    Declaration

    Swift

    public static let biometric: OathKeychainSecurityOptions
  • Maximum security configuration with biometrics and no fallback.

    Declaration

    Swift

    public static let biometricOnly: OathKeychainSecurityOptions
  • Shared keychain configuration for app group sharing.

    Declaration

    Swift

    public static func shared(accessGroup: String) -> OathKeychainSecurityOptions

    Parameters

    accessGroup

    The app group identifier.

    Return Value

    Security options configured for sharing.