···1111// FIXME: I have no idea what these are for, so they are 0 for now
1212#define session_keybag_handle 0
1313#define device_keybag_handle 0
1414+#define bad_keybag_handle (-1) // that's a pretty common "bad" signed integer value
14151516typedef uint32_t keybag_state_t;
1617typedef int32_t keybag_handle_t;
···4041extern kern_return_t aks_assert_hold(keybag_handle_t keybagHandle, AKSAssertionType_t lockAssertType, uint64_t timeout);
41424243extern kern_return_t aks_assert_drop(keybag_handle_t keybagHandle, AKSAssertionType_t lockAssertType);
4444+4545+enum {
4646+ kAKSReturnSuccess = 0, // 100% sure this is the correct value
4747+ kAKSReturnError = KERN_FAILURE, // 90% sure this is the correct value
4848+4949+ // i have no clue what these could be
5050+ kAKSReturnBusy,
5151+ kAKSReturnNoPermission,
5252+ kAKSReturnNotReady,
5353+ kAKSReturnTimeout,
5454+ kAKSReturnBadArgument,
5555+ kAKSReturnNotPrivileged,
5656+ kAKSReturnNotFound,
5757+ kAKSReturnDecodeError,
5858+ kAKSReturnPolicyError,
5959+ kAKSReturnBadDeviceKey,
6060+ kAKSReturnBadSignature,
6161+ kAKSReturnPolicyInvalid,
6262+};
6363+6464+typedef int32_t keyclass_t;
6565+6666+// i know it's a pointer, but it seems to be used opaquely, so not much more information
6767+// oh, it's also a CF type (deduced because it's used with `__bridge_retained` in Objective-C code)
6868+typedef void* aks_ref_key_t;
6969+7070+enum {
7171+ kAppleKeyStoreAsymmetricBackupBag,
7272+};
7373+7474+#define key_class_last (0)
43754476#ifdef __cplusplus
4577}