]> git.saurik.com Git - apple/security.git/blob - OSX/sec/SOSCircle/SecureObjectSync/SOSKVSKeys.h
Security-57740.31.2.tar.gz
[apple/security.git] / OSX / sec / SOSCircle / SecureObjectSync / SOSKVSKeys.h
1
2
3 #ifndef SOSKVSKEYS_H
4 #define SOSKVSKEYS_H
5
6 #include "SOSCircle.h"
7 #include <Security/SecureObjectSync/SOSTransportMessage.h>
8 #include <Security/SecureObjectSync/SOSTransportMessageKVS.h>
9
10 //
11 // MARK: Key formation
12 //
13
14 typedef enum {
15 kCircleKey = 0,
16 kMessageKey,
17 kParametersKey,
18 kInitialSyncKey,
19 kRetirementKey,
20 kAccountChangedKey,
21 kDebugInfoKey,
22 kRingKey,
23 kPeerInfoKey,
24 kLastCircleKey,
25 kLastKeyParameterKey,
26 kUnknownKey,
27 } SOSKVSKeyType;
28
29 extern const CFStringRef kSOSKVSKeyParametersKey;
30 extern const CFStringRef kSOSKVSInitialSyncKey;
31 extern const CFStringRef kSOSKVSAccountChangedKey;
32 extern const CFStringRef kSOSKVSRequiredKey;
33 extern const CFStringRef kSOSKVSOfficialDSIDKey;
34
35 //extern const CFStringRef kSOSKVSDebugInfo;
36
37 extern const CFStringRef sCirclePrefix;
38 extern const CFStringRef sRetirementPrefix;
39 extern const CFStringRef sLastCirclePushedPrefix;
40 extern const CFStringRef sLastKeyParametersPushedPrefix;
41 extern const CFStringRef sDebugInfoPrefix;
42
43 SOSKVSKeyType SOSKVSKeyGetKeyType(CFStringRef key);
44 bool SOSKVSKeyParse(SOSKVSKeyType keyType, CFStringRef key, CFStringRef *circle, CFStringRef *peerInfo, CFStringRef *ring, CFStringRef *backupName, CFStringRef *from, CFStringRef *to);
45 SOSKVSKeyType SOSKVSKeyGetKeyTypeAndParse(CFStringRef key, CFStringRef *circle, CFStringRef *peerInfo, CFStringRef *ring, CFStringRef *backupName, CFStringRef *from, CFStringRef *to);
46
47 CFStringRef SOSCircleKeyCreateWithCircle(SOSCircleRef circle, CFErrorRef *error);
48 CFStringRef SOSPeerInfoKeyCreateWithName(CFStringRef peer_info_name, CFErrorRef *error);
49 CFStringRef SOSRingKeyCreateWithName(CFStringRef ring_name, CFErrorRef *error);
50
51
52 CFStringRef SOSCircleKeyCreateWithName(CFStringRef name, CFErrorRef *error);
53 CFStringRef SOSCircleKeyCopyCircleName(CFStringRef key, CFErrorRef *error);
54 CFStringRef SOSMessageKeyCreateWithCircleNameAndPeerNames(CFStringRef circleName, CFStringRef from_peer_name, CFStringRef to_peer_name);
55
56 CFStringRef SOSMessageKeyCopyCircleName(CFStringRef key, CFErrorRef *error);
57 CFStringRef SOSMessageKeyCopyFromPeerName(CFStringRef messageKey, CFErrorRef *error);
58 CFStringRef SOSMessageKeyCreateWithCircleAndPeerNames(SOSCircleRef circle, CFStringRef from_peer_name, CFStringRef to_peer_name);
59 CFStringRef SOSMessageKeyCreateWithCircleAndPeerInfos(SOSCircleRef circle, SOSPeerInfoRef from_peer, SOSPeerInfoRef to_peer);
60
61 CFStringRef SOSRetirementKeyCreateWithCircleNameAndPeer(CFStringRef circle_name, CFStringRef retirement_peer_name);
62 CFStringRef SOSRetirementKeyCreateWithCircleAndPeer(SOSCircleRef circle, CFStringRef retirement_peer_name);
63
64 CFStringRef SOSMessageKeyCreateFromTransportToPeer(SOSTransportMessageRef transport, CFStringRef peer_name);
65 CFStringRef SOSMessageKeyCreateFromPeerToTransport(SOSTransportMessageRef transport, CFStringRef peer_name);
66 CFStringRef SOSMessageKeyCreateWithCircleNameAndTransportType(CFStringRef circleName, CFStringRef transportType);
67
68 CFStringRef SOSPeerInfoV2KeyCreateWithPeerName(CFStringRef peer_name);
69 CFStringRef SOSRingKeyCreateWithRingName(CFStringRef ring_name);
70 CFStringRef SOSLastCirclePushedKeyCreateWithCircleNameAndPeerID(CFStringRef circleName, CFStringRef peerID);
71 CFStringRef SOSLastCirclePushedKeyCreateWithAccountGestalt(SOSAccountRef account);
72 CFStringRef SOSLastKeyParametersPushedKeyCreateWithPeerID(CFStringRef peerID);
73 CFStringRef SOSLastKeyParametersPushedKeyCreateWithAccountGestalt(SOSAccountRef account);
74 CFStringRef SOSDebugInfoKeyCreateWithTypeName(CFStringRef type_name);
75
76 #endif