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

# kSecGuestAttributeHash

A key whose value is a data object containing the SHA-1 hash of the code directory.

```
let kSecGuestAttributeHash: CFString
```

## Discussion

This hash can be used as a unique identifier to recognize this specific code in the future. This identifier is tied to the current version of the code, unlike the [`kSecCodeInfoIdentifier`](/documentation/Security/kSecCodeInfoIdentifier) identifier, which remains stable across developer-approved updates. If you are not passing this hash in the attribute dictionary when you call the [`SecHostCreateGuest`](/documentation/Security/SecHostCreateGuest) function, then you must pass the [`kSecCSGenerateGuestHash`](/documentation/Security/kSecCSGenerateGuestHash) flag to the function as well.

---

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)