]> git.saurik.com Git - apple/security.git/blob - Analytics/Clients/LocalKeychainAnalytics.h
Security-59306.11.20.tar.gz
[apple/security.git] / Analytics / Clients / LocalKeychainAnalytics.h
1 #ifndef LocalKeychainAnalytics_h
2 #define LocalKeychainAnalytics_h
3
4 #include <CoreFoundation/CoreFoundation.h>
5
6 typedef enum {
7 LKAKeychainUpgradeOutcomeSuccess,
8 LKAKeychainUpgradeOutcomeUnknownFailure,
9 LKAKeychainUpgradeOutcomeLocked,
10 LKAKeychainUpgradeOutcomeInternal,
11 LKAKeychainUpgradeOutcomeNewDb,
12 LKAKeychainUpgradeOutcomeObsoleteDb,
13 LKAKeychainUpgradeOutcomeNoSchema,
14 LKAKeychainUpgradeOutcomeIndices,
15 LKAKeychainUpgradeOutcomePhase1AlterTables,
16 LKAKeychainUpgradeOutcomePhase1DropIndices,
17 LKAKeychainUpgradeOutcomePhase1CreateSchema,
18 LKAKeychainUpgradeOutcomePhase1Items,
19 LKAKeychainUpgradeOutcomePhase1NonItems,
20 LKAKeychainUpgradeOutcomePhase1DropOld,
21 LKAKeychainUpgradeOutcomePhase2,
22 } LKAKeychainUpgradeOutcome;
23
24 typedef enum {
25 LKAKeychainBackupTypeNeither,
26 LKAKeychainBackupTypeBag,
27 LKAKeychainBackupTypeCode,
28 LKAKeychainBackupTypeBagAndCode,
29 LKAKeychainBackupTypeEMCS,
30 } LKAKeychainBackupType;
31
32 void LKAReportKeychainUpgradeOutcome(int fromversion, int toversion, LKAKeychainUpgradeOutcome outcome);
33 void LKAReportKeychainUpgradeOutcomeWithError(int fromversion, int toversion, LKAKeychainUpgradeOutcome outcome, CFErrorRef error);
34
35 void LKABackupReportStart(bool hasKeybag, bool hasPasscode, bool isEMCS);
36 void LKABackupReportEnd(bool hasBackup, CFErrorRef error);
37
38 #if __OBJC2__
39
40 #import <Foundation/Foundation.h>
41 #import <Security/SFAnalytics.h>
42
43 typedef NSString* LKAnalyticsFailableEvent NS_STRING_ENUM;
44 typedef NSString* LKAnalyticsMetric NS_STRING_ENUM;
45
46 extern LKAnalyticsFailableEvent const LKAEventUpgrade;
47
48 @interface LocalKeychainAnalytics : SFAnalytics
49
50 - (void)reportKeychainUpgradeFrom:(int)oldVersion to:(int)newVersion outcome:(LKAKeychainUpgradeOutcome)result error:(NSError*)error;
51
52 @end
53
54 #endif // OBJC2
55 #endif // LocalKeychainAnalytics_h