]> git.saurik.com Git - apple/security.git/blob - KeychainCircle/KCDer.h
Security-58286.220.15.tar.gz
[apple/security.git] / KeychainCircle / KCDer.h
1 //
2 // KCDer.h
3 // KeychainCircle
4 //
5 //
6
7 #include <Foundation/Foundation.h>
8 #include <corecrypto/ccder.h>
9
10 NS_ASSUME_NONNULL_BEGIN
11
12 // These should probably be shared with security, but we don't export our der'izing functions yet.
13 const uint8_t* _Nullable
14 kcder_decode_data_nocopy(NSData* _Nullable * _Nonnull data,
15 NSError* _Nullable * _Nullable error,
16 const uint8_t* _Nonnull der, const uint8_t * _Nullable der_end);
17 const uint8_t* _Nullable
18 kcder_decode_data(NSData* _Nullable* _Nonnull data, NSError* _Nullable * _Nullable error,
19 const uint8_t* der, const uint8_t * _Nullable der_end);
20 size_t
21 kcder_sizeof_data(NSData* data, NSError** error);
22 uint8_t* _Nullable
23 kcder_encode_data(NSData* data, NSError**error,
24 const uint8_t * _Nonnull der, uint8_t * _Nullable der_end);
25 uint8_t* _Nullable
26 kcder_encode_data_optional(NSData* _Nullable data, NSError* _Nullable * _Nullable error,
27 const uint8_t *der, uint8_t *der_end);
28
29 const uint8_t* _Nullable
30 kcder_decode_string(NSString*_Nullable * _Nonnull string,
31 NSError* _Nullable * _Nullable error,
32 const uint8_t* _Nonnull der,
33 const uint8_t* _Nullable der_end);
34 size_t
35 kcder_sizeof_string(NSString* string,
36 NSError* _Nullable * _Nullable error);
37 uint8_t* _Nullable
38 kcder_encode_string(NSString* string,
39 NSError* _Nullable * _Nullable error,
40 const uint8_t * _Nonnull der, uint8_t * _Nullable der_end);
41
42 uint8_t *
43 kcder_encode_raw_octet_space(size_t s_size, uint8_t * _Nullable * _Nonnull location,
44 const uint8_t * _Nonnull der, uint8_t * _Nullable der_end);
45
46 NS_ASSUME_NONNULL_END