---
title: SecKeychainLockAll()
framework: security
role: symbol
role_heading: Function
path: security/seckeychainlockall()
---

# SecKeychainLockAll()

Locks all keychains belonging to the current user.

## Declaration

```swift
func SecKeychainLockAll() -> OSStatus
```

## Return Value

Return Value A result code. See Security Framework Result Codes.

## Discussion

Discussion Your application should not call this function unless you are responding to a user’s request to lock a keychain. In general, you should leave the keychain unlocked so that the user does not have to unlock it again in another application.
