<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecKeychainEvent/lockEvent",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@E@SecKeychainEvent@kSecLockEvent"
  },
  "title" : "SecKeychainEvent.lockEvent"
}
-->

# SecKeychainEvent.lockEvent

Indicates a keychain was locked.

```
case lockEvent
```

## Discussion

It is impossible to distinguish between a lock event caused by an explicit request and one caused by a keychain that locked itself because of a timeout. Therefore, the `pid` parameter in the [`SecKeychainCallbackInfo`](/documentation/Security/SecKeychainCallbackInfo) structure does not contain useful information for this event. Note that when the login session terminates, all keychains become effectively locked; however, no `kSecLockEvent` events are generated in this case.

---

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)