]> git.saurik.com Git - apple/security.git/blob - keychain/escrowrequest/Framework/SecEscrowRequest.h
Security-59306.101.1.tar.gz
[apple/security.git] / keychain / escrowrequest / Framework / SecEscrowRequest.h
1
2 #import <Foundation/Foundation.h>
3
4 NS_ASSUME_NONNULL_BEGIN
5
6 extern NSString* const SecEscrowRequestHavePrecord;
7 extern NSString* const SecEscrowRequestPendingPasscode;
8 extern NSString* const SecEscrowRequestPendingCertificate;
9
10 @protocol SecEscrowRequestable <NSObject>
11 + (id<SecEscrowRequestable> _Nullable)request:(NSError* _Nullable *)error;
12 - (BOOL)triggerEscrowUpdate:(NSString*)reason
13 error:(NSError**)error;
14 - (NSDictionary *_Nullable)fetchStatuses:(NSError **)error;
15
16 - (bool)pendingEscrowUpload:(NSError**)error;
17
18 @end
19
20 @interface SecEscrowRequest : NSObject <SecEscrowRequestable>
21 + (SecEscrowRequest* _Nullable)request:(NSError* _Nullable *)error;
22 - (instancetype)initWithConnection:(NSXPCConnection*)connection;
23
24
25 - (BOOL)triggerEscrowUpdate:(NSString*)reason
26 error:(NSError**)error;
27
28 - (BOOL)cachePrerecord:(NSString*)uuid
29 serializedPrerecord:(NSData*)prerecord
30 error:(NSError**)error;
31
32 - (NSData* _Nullable)fetchPrerecord:(NSString*)prerecordUUID
33 error:(NSError**)error;
34
35 // Returns a UUIDs of an escrow request which is ready to receive the device passcode.
36 // For a request to be in this state, sbd must have successfully cached a certificate in beginHSA2PasscodeRequest.
37 - (NSString* _Nullable)fetchRequestWaitingOnPasscode:(NSError**)error;
38
39 // Reset and delete all pending requests.
40 - (BOOL)resetAllRequests:(NSError**)error;
41
42 - (uint64_t)storePrerecordsInEscrow:(NSError**)error;
43 @end
44
45 NS_ASSUME_NONNULL_END