<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecKeychainSettings/init(version:lockOnSleep:useLockInterval:lockInterval:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "s:So19SecKeychainSettingsV7version11lockOnSleep15useLockInterval0eJ0ABs6UInt32V_6Darwin0L7BooleanVAkHtcfc"
  },
  "title" : "init(version:lockOnSleep:useLockInterval:lockInterval:)"
}
-->

# init(version:lockOnSleep:useLockInterval:lockInterval:)

Initializes a keychain settings structures with the given values.

```
init(version: UInt32, lockOnSleep: DarwinBoolean, useLockInterval: DarwinBoolean, lockInterval: UInt32)
```

## Parameters

`version`

The keychain version. Use [`SEC_KEYCHAIN_SETTINGS_VERS1`](/documentation/Security/SEC_KEYCHAIN_SETTINGS_VERS1).

`lockOnSleep`

A Boolean indicating whether the keychain locks when the system enters sleep mode.

`useLockInterval`

A Boolean indicating whether the keychain locks after an time period elapses, as given by [`lockInterval`](/documentation/Security/SecKeychainSettings/lockInterval).

`lockInterval`

The number of seconds after which the keychain should lock if [`useLockInterval`](/documentation/Security/SecKeychainSettings/useLockInterval) is <doc://com.apple.documentation/documentation/Swift/true>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)