]> git.saurik.com Git - apple/security.git/blob - sec/SOSCircle/SecureObjectSync/SOSFullPeerInfo.h
Security-55471.14.8.tar.gz
[apple/security.git] / sec / SOSCircle / SecureObjectSync / SOSFullPeerInfo.h
1 //
2 // SOSFullPeerInfo.h
3 // sec
4 //
5 // Created by Mitch Adler on 10/26/12.
6 //
7 //
8
9 #ifndef _SOSFULLPEERINFO_H_
10 #define _SOSFULLPEERINFO_H_
11
12 #include <CoreFoundation/CoreFoundation.h>
13 #include <Security/SecKey.h>
14 #include <CommonCrypto/CommonDigestSPI.h>
15 #include <SecureObjectSync/SOSPeerInfo.h>
16
17 __BEGIN_DECLS
18
19 typedef struct __OpaqueSOSFullPeerInfo *SOSFullPeerInfoRef;
20
21 enum {
22 kSOSFullPeerVersion = 1,
23 };
24
25 SOSFullPeerInfoRef SOSFullPeerInfoCreate(CFAllocatorRef allocator, CFDictionaryRef gestalt, SecKeyRef signingKey, CFErrorRef *error);
26
27 SOSFullPeerInfoRef SOSFullPeerInfoCreateCloudIdentity(CFAllocatorRef allocator, SOSPeerInfoRef peer, CFErrorRef* error);
28
29 SOSPeerInfoRef SOSFullPeerInfoGetPeerInfo(SOSFullPeerInfoRef fullPeer);
30 SecKeyRef SOSFullPeerInfoCopyDeviceKey(SOSFullPeerInfoRef fullPeer, CFErrorRef* error);
31
32 bool SOSFullPeerInfoPurgePersistentKey(SOSFullPeerInfoRef peer, CFErrorRef* error);
33
34 SOSPeerInfoRef SOSFullPeerInfoPromoteToRetiredAndCopy(SOSFullPeerInfoRef peer, CFErrorRef *error);
35
36 bool SOSFullPeerInfoValidate(SOSFullPeerInfoRef peer, CFErrorRef* error);
37
38 bool SOSFullPeerInfoUpdateGestalt(SOSFullPeerInfoRef peer, CFDictionaryRef gestalt, CFErrorRef* error);
39
40 bool SOSFullPeerInfoPromoteToApplication(SOSFullPeerInfoRef fpi, SecKeyRef user_key, CFErrorRef *error);
41
42 bool SOSFullPeerInfoUpgradeSignatures(SOSFullPeerInfoRef fpi, SecKeyRef user_key, CFErrorRef *error);
43
44 //
45 // DER Import Export
46 //
47 SOSFullPeerInfoRef SOSFullPeerInfoCreateFromDER(CFAllocatorRef allocator, CFErrorRef* error,
48 const uint8_t** der_p, const uint8_t *der_end);
49
50 SOSFullPeerInfoRef SOSFullPeerInfoCreateFromData(CFAllocatorRef allocator, CFDataRef fullPeerData, CFErrorRef *error);
51
52 size_t SOSFullPeerInfoGetDEREncodedSize(SOSFullPeerInfoRef peer, CFErrorRef *error);
53 uint8_t* SOSFullPeerInfoEncodeToDER(SOSFullPeerInfoRef peer, CFErrorRef* error,
54 const uint8_t* der, uint8_t* der_end);
55
56 CFDataRef SOSFullPeerInfoCopyEncodedData(SOSFullPeerInfoRef peer, CFAllocatorRef allocator, CFErrorRef *error);
57
58 __END_DECLS
59
60 #endif