]> git.saurik.com Git - apple/security.git/blob - utilities/src/der_plist.h
Security-55471.14.tar.gz
[apple/security.git] / utilities / src / der_plist.h
1 //
2 // der_plist.h
3 // utilities
4 //
5 // Created by Mitch Adler on 6/18/12.
6 // Copyright (c) 2012 Apple Inc. All rights reserved.
7 //
8
9 #ifndef _DER_PLIST_H_
10 #define _DER_PLIST_H_
11
12 #include <CoreFoundation/CoreFoundation.h>
13
14 //
15 // Error Codes for PropertyList <-> DER
16 //
17
18 static const CFIndex kSecDERErrorUnknownEncoding = -1;
19 static const CFIndex kSecDERErrorUnsupportedCFObject = -2;
20 static const CFIndex kSecDERErrorUnsupportedDERType = -2;
21 static const CFIndex kSecDERErrorAllocationFailure = -3;
22 static const CFIndex kSecDERErrorUnsupportedNumberType = -4;
23
24 static const CFIndex kSecDERErrorUnderlyingError = -100;
25
26 extern CFStringRef sSecDERErrorDomain;
27
28 // PropertyList <-> DER Functions
29
30 size_t der_sizeof_plist(CFPropertyListRef pl, CFErrorRef *error);
31
32 uint8_t* der_encode_plist(CFPropertyListRef pl, CFErrorRef *error,
33 const uint8_t *der, uint8_t *der_end);
34
35 const uint8_t* der_decode_plist(CFAllocatorRef pl, CFOptionFlags mutability,
36 CFPropertyListRef* cf, CFErrorRef *error,
37 const uint8_t* der, const uint8_t *der_end);
38
39 #endif