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

# SecKeychainEventMask

Bit masks corresponding to the events that can trigger a keychain callback.

```
struct SecKeychainEventMask
```

## Overview

Bitwise `OR` one or more of these masks together to provide the `eventMask` input to the [`SecKeychainAddCallback(_:_:_:)`](/documentation/Security/SecKeychainAddCallback(_:_:_:)) function to indicate what event or events should trigger your callback.

## Topics

### Initializers

[`init(rawValue:)`](/documentation/Security/SecKeychainEventMask/init(rawValue:))

Initializes an event mask value.

### Constants

[`lockEventMask`](/documentation/Security/SecKeychainEventMask/lockEventMask)

If the bit specified by this mask is set, your callback function is invoked when a keychain is locked.

[`unlockEventMask`](/documentation/Security/SecKeychainEventMask/unlockEventMask)

If the bit specified by this mask is set, your callback function is invoked when a keychain is unlocked.

[`addEventMask`](/documentation/Security/SecKeychainEventMask/addEventMask)

If the bit specified by this mask is set, your callback function is invoked when an item is added to a keychain.

[`deleteEventMask`](/documentation/Security/SecKeychainEventMask/deleteEventMask)

If the bit specified by this mask is set, your callback function is invoked when an item is deleted from a keychain.

[`updateEventMask`](/documentation/Security/SecKeychainEventMask/updateEventMask)

If the bit specified by this mask is set, your callback function is invoked when a keychain item is updated.

[`passwordChangedEventMask`](/documentation/Security/SecKeychainEventMask/passwordChangedEventMask)

If the bit specified by this mask is set, your callback function is invoked when the keychain password is changed.

[`defaultChangedEventMask`](/documentation/Security/SecKeychainEventMask/defaultChangedEventMask)

If the bit specified by this mask is set, your callback function is invoked when a different keychain is specified as the default.

[`dataAccessEventMask`](/documentation/Security/SecKeychainEventMask/dataAccessEventMask)

If the bit specified by this mask is set, your callback function is invoked when a process accesses a keychain item’s data.

[`keychainListChangedMask`](/documentation/Security/SecKeychainEventMask/keychainListChangedMask)

If the bit specified by this mask is set, your callback function is invoked when a keychain list is changed.

[`trustSettingsChangedEventMask`](/documentation/Security/SecKeychainEventMask/trustSettingsChangedEventMask)

If the bit specified by this mask is set, your callback function is invoked when there is a change in certificate trust settings.

[`everyEventMask`](/documentation/Security/SecKeychainEventMask/everyEventMask)

If all the bits are set, your callback function is invoked whenever any event occurs.



---

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)