]>
Commit | Line | Data |
---|---|---|
866f8763 A |
1 | // |
2 | // SecurityPairing.h | |
3 | // Security | |
4 | // | |
5 | ||
6 | #import <Foundation/Foundation.h> | |
7 | #import <Security/SecureObjectSync/SOSTypes.h> | |
8 | ||
9 | extern NSString *kKCPairingChannelErrorDomain; | |
10 | ||
11 | #define KCPairingErrorNoControlChannel 1 | |
12 | #define KCPairingErrorTooManySteps 2 | |
13 | #define KCPairingErrorAccountCredentialMissing 3 | |
14 | ||
15 | typedef void(^KCPairingChannelCompletion)(BOOL complete, NSData *packet, NSError *error); | |
16 | ||
17 | @interface KCPairingChannelContext : NSObject | |
18 | @property (strong) NSString *model; | |
19 | @property (strong) NSString *modelVersion; | |
20 | @property (strong) NSString *modelClass; | |
21 | @property (strong) NSString *osVersion; | |
22 | @end | |
23 | ||
24 | @interface KCPairingChannel : NSObject | |
25 | ||
26 | @property (assign,readonly) BOOL needInitialSync; | |
27 | ||
28 | + (instancetype)pairingChannelInitiator:(KCPairingChannelContext *)peerVersionContext; | |
29 | + (instancetype)pairingChannelAcceptor:(KCPairingChannelContext *)peerVersionContext; | |
30 | ||
31 | - (instancetype)initAsInitiator:(bool)initator version:(KCPairingChannelContext *)peerVersionContext; | |
32 | - (void)validateStart:(void(^)(bool result, NSError *error))complete; | |
33 | ||
34 | - (NSData *)exchangePacket:(NSData *)data complete:(bool *)complete error:(NSError **)error; | |
35 | ||
36 | /* for tests cases only */ | |
37 | - (void)setXPCConnectionObject:(NSXPCConnection *)connection; | |
38 | @end | |
39 |