5 // Created by Mitch Adler on 6/18/12.
6 // Copyright (c) 2012 Apple Inc. All rights reserved.
12 #include <CoreFoundation/CoreFoundation.h>
15 // Error Codes for PropertyList <-> DER
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;
24 static const CFIndex kSecDERErrorUnderlyingError
= -100;
26 extern CFStringRef sSecDERErrorDomain
;
28 // PropertyList <-> DER Functions
30 size_t der_sizeof_plist(CFPropertyListRef pl
, CFErrorRef
*error
);
32 uint8_t* der_encode_plist(CFPropertyListRef pl
, CFErrorRef
*error
,
33 const uint8_t *der
, uint8_t *der_end
);
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
);