<!--
{
  "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

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

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

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

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

[`kSecAddEventMask`](/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.

[`kSecDeleteEventMask`](/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.

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

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

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

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

[`kSecDefaultChangedEventMask`](/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.

[`kSecDataAccessEventMask`](/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.

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

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

[`kSecTrustSettingsChangedEventMask`](/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.

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

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

## Relationships

### Conforms To

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`OptionSet`](/documentation/Swift/OptionSet)

[`Equatable`](/documentation/Swift/Equatable)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

---

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)