@@ -13,18 +13,85 @@ struct pouch_gateway_server_cert_context;
1313#include <stdbool.h>
1414#include <stddef.h>
1515
16+ /**
17+ * Start device certificate handling.
18+ *
19+ * @return Pointer to the device certificate context.
20+ */
1621struct pouch_gateway_device_cert_context * pouch_gateway_device_cert_start (void );
22+
23+ /**
24+ * Push data to the device certificate context.
25+ *
26+ * @param context The device certificate context.
27+ * @param data The data to push.
28+ * @param len The length of the data.
29+ * @return 0 on success, negative on error.
30+ */
1731int pouch_gateway_device_cert_push (struct pouch_gateway_device_cert_context * context , const void * data , size_t len );
32+
33+ /**
34+ * Abort device certificate handling.
35+ *
36+ * @param context The device certificate context.
37+ */
1838void pouch_gateway_device_cert_abort (struct pouch_gateway_device_cert_context * context );
39+
40+ /**
41+ * Finish device certificate handling.
42+ *
43+ * @param context The device certificate context.
44+ * @return 0 on success, negative on error.
45+ */
1946int pouch_gateway_device_cert_finish (struct pouch_gateway_device_cert_context * context );
2047
48+ /**
49+ * Start server certificate handling.
50+ *
51+ * @return Pointer to the server certificate context.
52+ */
2153struct pouch_gateway_server_cert_context * pouch_gateway_server_cert_start (void );
54+
55+ /**
56+ * Abort server certificate handling.
57+ *
58+ * @param context The server certificate context.
59+ */
2260void pouch_gateway_server_cert_abort (struct pouch_gateway_server_cert_context * context );
61+
62+ /**
63+ * Check if the server certificate is the newest.
64+ *
65+ * @param context The server certificate context.
66+ * @return True if newest, false otherwise.
67+ */
2368bool pouch_gateway_server_cert_is_newest (const struct pouch_gateway_server_cert_context * context );
69+
70+ /**
71+ * Check if the server certificate is complete.
72+ *
73+ * @param context The server certificate context.
74+ * @return True if complete, false otherwise.
75+ */
2476bool pouch_gateway_server_cert_is_complete (const struct pouch_gateway_server_cert_context * context );
77+
78+ /**
79+ * Get data from the server certificate context.
80+ *
81+ * @param context The server certificate context.
82+ * @param dst Destination buffer.
83+ * @param dst_len Length of the destination buffer.
84+ * @param is_last True if this is the last chunk.
85+ * @return 0 on success, negative on error.
86+ */
2587int pouch_gateway_server_cert_get_data (struct pouch_gateway_server_cert_context * context ,
2688 void * dst ,
2789 size_t * dst_len ,
2890 bool * is_last );
2991
92+ /**
93+ * Callback when connected to Golioth client for certificate module.
94+ *
95+ * @param client The Golioth client.
96+ */
3097void pouch_gateway_cert_module_on_connected (struct golioth_client * client );
0 commit comments