]> git.saurik.com Git - apple/security.git/blob - keychain/SecureObjectSync/SOSPeerInfoPriv.h
Security-59754.41.1.tar.gz
[apple/security.git] / keychain / SecureObjectSync / SOSPeerInfoPriv.h
1 //
2 // SOSPeerInfoPriv.h
3 // sec
4 //
5 // Created by Richard Murphy on 12/4/14.
6 //
7 //
8
9 #ifndef sec_SOSPeerInfoPriv_h
10 #define sec_SOSPeerInfoPriv_h
11
12 #include <CoreFoundation/CFRuntime.h>
13 #include <CoreFoundation/CoreFoundation.h>
14 #include <utilities/SecCFWrappers.h>
15
16 struct __OpaqueSOSPeerInfo {
17 CFRuntimeBase _base;
18 //
19 CFMutableDictionaryRef description;
20 CFDataRef signature;
21
22 // Cached data
23 CFDictionaryRef gestalt;
24 CFStringRef peerID;
25 CFStringRef spid;
26 CFIndex version;
27 CFStringRef verifiedAppKeyID;
28 bool verifiedResult;
29
30 /* V2 and beyond are listed below */
31 CFMutableDictionaryRef v2Dictionary;
32 };
33
34 CF_RETURNS_RETAINED SOSPeerInfoRef SOSPeerInfoAllocate(CFAllocatorRef allocator);
35 bool SOSPeerInfoSign(SecKeyRef privKey, SOSPeerInfoRef peer, CFErrorRef *error);
36 bool SOSPeerInfoVerify(SOSPeerInfoRef peer, CFErrorRef *error);
37 void SOSPeerInfoSetVersionNumber(SOSPeerInfoRef pi, int version);
38
39 SOSPeerInfoRef SOSPeerInfoCopyWithModification(CFAllocatorRef allocator, SOSPeerInfoRef original,
40 SecKeyRef signingKey, CFErrorRef *error,
41 bool (^modification)(SOSPeerInfoRef peerToModify, CFErrorRef *error));
42
43 extern const CFStringRef peerIDLengthKey;
44
45 #endif