]> git.saurik.com Git - apple/security.git/blob - OSX/sec/SOSCircle/SecureObjectSync/SOSKVSKeys.h
Security-58286.41.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/SOSTransportMessageKVS.h>
8 #include <Security/SecureObjectSync/SOSAccountPriv.h>
9 //
10 // MARK: Key formation
11 //
12
13 typedef enum {
14 kCircleKey = 0,
15 kMessageKey,
16 kParametersKey,
17 kInitialSyncKey,
18 kRetirementKey,
19 kAccountChangedKey,
20 kDebugInfoKey,
21 kRingKey,
22 kLastCircleKey,
23 kLastKeyParameterKey,
24 kOTRConfig,
25 kUnknownKey,
26 } SOSKVSKeyType;
27
28 extern const CFStringRef kSOSKVSKeyParametersKey;
29 extern const CFStringRef kSOSKVSInitialSyncKey;
30 extern const CFStringRef kSOSKVSAccountChangedKey;
31 extern const CFStringRef kSOSKVSRequiredKey;
32 extern const CFStringRef kSOSKVSOfficialDSIDKey;
33 extern const CFStringRef kSOSKVSLastCleanupTimestampKey;
34 extern const CFStringRef kSOSKVSOTRConfigVersion;
35 extern const CFStringRef kSOSKVSWroteLastKeyParams;
36
37 extern const CFStringRef sCirclePrefix;
38 extern const CFStringRef sRetirementPrefix;
39 extern const CFStringRef sDebugInfoPrefix;
40
41 SOSKVSKeyType SOSKVSKeyGetKeyType(CFStringRef key);
42 bool SOSKVSKeyParse(SOSKVSKeyType keyType, CFStringRef key, CFStringRef *circle, CFStringRef *peerInfo, CFStringRef *ring, CFStringRef *backupName, CFStringRef *from, CFStringRef *to);
43 SOSKVSKeyType SOSKVSKeyGetKeyTypeAndParse(CFStringRef key, CFStringRef *circle, CFStringRef *peerInfo, CFStringRef *ring, CFStringRef *backupName, CFStringRef *from, CFStringRef *to);
44
45 CFStringRef SOSCircleKeyCreateWithCircle(SOSCircleRef circle, CFErrorRef *error);
46 CFStringRef SOSRingKeyCreateWithName(CFStringRef ring_name, CFErrorRef *error);
47
48
49 CFStringRef SOSCircleKeyCreateWithName(CFStringRef name, CFErrorRef *error);
50 CFStringRef SOSCircleKeyCopyCircleName(CFStringRef key, CFErrorRef *error);
51 CFStringRef SOSMessageKeyCreateWithCircleNameAndPeerNames(CFStringRef circleName, CFStringRef from_peer_name, CFStringRef to_peer_name);
52
53 CFStringRef SOSMessageKeyCopyCircleName(CFStringRef key, CFErrorRef *error);
54 CFStringRef SOSMessageKeyCopyFromPeerName(CFStringRef messageKey, CFErrorRef *error);
55 CFStringRef SOSMessageKeyCreateWithCircleAndPeerNames(SOSCircleRef circle, CFStringRef from_peer_name, CFStringRef to_peer_name);
56 CFStringRef SOSMessageKeyCreateWithCircleAndPeerInfos(SOSCircleRef circle, SOSPeerInfoRef from_peer, SOSPeerInfoRef to_peer);
57
58 CFStringRef SOSRetirementKeyCreateWithCircleNameAndPeer(CFStringRef circle_name, CFStringRef retirement_peer_name);
59 CFStringRef SOSRetirementKeyCreateWithCircleAndPeer(SOSCircleRef circle, CFStringRef retirement_peer_name);
60
61 CFStringRef SOSMessageKeyCreateFromTransportToPeer(SOSMessage* transport, CFStringRef myID, CFStringRef peer_name);
62 CFStringRef SOSMessageKeyCreateFromPeerToTransport(SOSMessage* transport, CFStringRef myID, CFStringRef peer_name);
63 CFStringRef SOSLastKeyParametersPushedKeyCreateWithAccountGestalt(SOSAccount* account);
64 CFStringRef SOSMessageKeyCreateWithCircleNameAndTransportType(CFStringRef circleName, CFStringRef transportType);
65
66 CFStringRef SOSRingKeyCreateWithRingName(CFStringRef ring_name);
67 CFStringRef SOSLastKeyParametersPushedKeyCreateWithPeerID(CFStringRef peerID);
68 CFStringRef SOSDebugInfoKeyCreateWithTypeName(CFStringRef type_name);
69
70 #endif