2 * Copyright (c) 2013-2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
27 The functions provided in SOSTransport.h provide an interface to the
28 secure object syncing transport
31 #ifndef _SEC_SOSMANIFEST_H_
32 #define _SEC_SOSMANIFEST_H_
34 #include <corecrypto/ccsha1.h>
35 #include <CoreFoundation/CFData.h>
36 #include <CoreFoundation/CFError.h>
41 kSOSManifestUnsortedError
= 1,
42 kSOSManifestCreateError
= 2,
45 extern CFStringRef kSOSManifestErrorDomain
;
49 /* Forward declarations of SOS types. */
50 typedef struct __OpaqueSOSManifest
*SOSManifestRef
;
51 struct SOSDigestVector
;
54 CFTypeID
SOSManifestGetTypeID(void);
56 SOSManifestRef
SOSManifestCreateWithBytes(const uint8_t *bytes
, size_t len
,
58 SOSManifestRef
SOSManifestCreateWithDigestVector(struct SOSDigestVector
*dv
, CFErrorRef
*error
);
59 SOSManifestRef
SOSManifestCreateWithData(CFDataRef data
, CFErrorRef
*error
);
61 size_t SOSManifestGetSize(SOSManifestRef m
);
63 size_t SOSManifestGetCount(SOSManifestRef m
);
65 const uint8_t *SOSManifestGetBytePtr(SOSManifestRef m
);
67 CFDataRef
SOSManifestGetData(SOSManifestRef m
);
69 const struct SOSDigestVector
*SOSManifestGetDigestVector(SOSManifestRef manifest
);
71 bool SOSManifestDiff(SOSManifestRef a
, SOSManifestRef b
,
72 SOSManifestRef
*a_minus_b
, SOSManifestRef
*b_minus_a
,
75 SOSManifestRef
SOSManifestCreateWithPatch(SOSManifestRef base
,
76 SOSManifestRef removals
,
77 SOSManifestRef additions
,
80 // Returns the set of elements in B that are not in A.
81 // This is the relative complement of A in B (B\A), sometimes written B − A
82 SOSManifestRef
SOSManifestCreateComplement(SOSManifestRef A
,
86 SOSManifestRef
SOSManifestCreateIntersection(SOSManifestRef m1
,
91 SOSManifestRef
SOSManifestCreateUnion(SOSManifestRef m1
,
95 void SOSManifestForEach(SOSManifestRef m
, void(^block
)(CFDataRef e
, bool *stop
));
97 CFDataRef
SOSManifestGetDigest(SOSManifestRef m
, CFErrorRef
*error
);
101 #endif /* !_SEC_SOSMANIFEST_H_ */