2 #import <Foundation/Foundation.h>
4 NS_ASSUME_NONNULL_BEGIN
6 extern NSString
* const SecEscrowRequestHavePrecord
;
7 extern NSString
* const SecEscrowRequestPendingPasscode
;
8 extern NSString
* const SecEscrowRequestPendingCertificate
;
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
;
16 - (bool)pendingEscrowUpload
:(NSError
**)error
;
20 @interface SecEscrowRequest
: NSObject
<SecEscrowRequestable
>
21 + (SecEscrowRequest
* _Nullable
)request
:(NSError
* _Nullable
*)error
;
22 - (instancetype
)initWithConnection
:(NSXPCConnection
*)connection
;
25 - (BOOL
)triggerEscrowUpdate
:(NSString
*)reason
26 error
:(NSError
**)error
;
28 - (BOOL
)cachePrerecord
:(NSString
*)uuid
29 serializedPrerecord
:(NSData
*)prerecord
30 error
:(NSError
**)error
;
32 - (NSData
* _Nullable
)fetchPrerecord
:(NSString
*)prerecordUUID
33 error
:(NSError
**)error
;
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
;
39 // Reset and delete all pending requests.
40 - (BOOL
)resetAllRequests
:(NSError
**)error
;
42 - (uint64_t)storePrerecordsInEscrow
:(NSError
**)error
;