]> git.saurik.com Git - apple/security.git/blob - keychain/SecureObjectSync/SOSKVSKeys.h
Security-59306.101.1.tar.gz
[apple/security.git] / keychain / SecureObjectSync / SOSKVSKeys.h
1
2
3 #ifndef SOSKVSKEYS_H
4 #define SOSKVSKEYS_H
5
6 #include "keychain/SecureObjectSync/SOSCircle.h"
7 #include "keychain/SecureObjectSync/SOSTransportMessageKVS.h"
8 #include "keychain/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 kUnknownKey,
25 } SOSKVSKeyType;
26
27 extern const CFStringRef kSOSKVSKeyParametersKey;
28 extern const CFStringRef kSOSKVSInitialSyncKey;
29 extern const CFStringRef kSOSKVSAccountChangedKey;
30 extern const CFStringRef kSOSKVSRequiredKey;
31 extern const CFStringRef kSOSKVSOfficialDSIDKey;
32 extern const CFStringRef kSOSKVSLastCleanupTimestampKey;
33 extern const CFStringRef kSOSKVSOTRConfigVersion;
34 extern const CFStringRef kSOSKVSWroteLastKeyParams;
35
36 extern const CFStringRef sCirclePrefix;
37 extern const CFStringRef sRetirementPrefix;
38 extern const CFStringRef sDebugInfoPrefix;
39
40 SOSKVSKeyType SOSKVSKeyGetKeyType(CFStringRef key);
41 bool SOSKVSKeyParse(SOSKVSKeyType keyType, CFStringRef key, CFStringRef *circle, CFStringRef *peerInfo, CFStringRef *ring, CFStringRef *backupName, CFStringRef *from, CFStringRef *to);
42 SOSKVSKeyType SOSKVSKeyGetKeyTypeAndParse(CFStringRef key, CFStringRef *circle, CFStringRef *peerInfo, CFStringRef *ring, CFStringRef *backupName, CFStringRef *from, CFStringRef *to);
43
44 CFStringRef SOSCircleKeyCreateWithCircle(SOSCircleRef circle, CFErrorRef *error);
45 CFStringRef SOSRingKeyCreateWithName(CFStringRef ring_name, CFErrorRef *error);
46
47
48 CFStringRef SOSCircleKeyCreateWithName(CFStringRef name, CFErrorRef *error);
49 CFStringRef SOSCircleKeyCopyCircleName(CFStringRef key, CFErrorRef *error);
50 CFStringRef SOSMessageKeyCreateWithCircleNameAndPeerNames(CFStringRef circleName, CFStringRef from_peer_name, CFStringRef to_peer_name);
51
52 CFStringRef SOSMessageKeyCopyCircleName(CFStringRef key, CFErrorRef *error);
53 CFStringRef SOSMessageKeyCopyFromPeerName(CFStringRef messageKey, CFErrorRef *error);
54 CFStringRef SOSMessageKeyCreateWithCircleAndPeerNames(SOSCircleRef circle, CFStringRef from_peer_name, CFStringRef to_peer_name);
55 CFStringRef SOSMessageKeyCreateWithCircleAndPeerInfos(SOSCircleRef circle, SOSPeerInfoRef from_peer, SOSPeerInfoRef to_peer);
56
57 CFStringRef SOSRetirementKeyCreateWithCircleNameAndPeer(CFStringRef circle_name, CFStringRef retirement_peer_name);
58 CFStringRef SOSRetirementKeyCreateWithCircleAndPeer(SOSCircleRef circle, CFStringRef retirement_peer_name);
59
60 CFStringRef SOSMessageKeyCreateFromTransportToPeer(SOSMessage* transport, CFStringRef myID, CFStringRef peer_name);
61 CFStringRef SOSMessageKeyCreateFromPeerToTransport(SOSMessage* transport, CFStringRef myID, CFStringRef peer_name);
62 CFStringRef SOSLastKeyParametersPushedKeyCreateWithAccountGestalt(SOSAccount* account);
63
64 CFStringRef SOSRingKeyCreateWithRingName(CFStringRef ring_name);
65 CFStringRef SOSLastKeyParametersPushedKeyCreateWithPeerID(CFStringRef peerID);
66 CFStringRef SOSDebugInfoKeyCreateWithTypeName(CFStringRef type_name);
67
68 #endif