1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2017-2020, Linaro Limited
4  */
5 #ifndef LIBCKTEEC_SERIALIZE_CK_H
6 #define LIBCKTEEC_SERIALIZE_CK_H
7 
8 #include <pkcs11.h>
9 
10 #include "serializer.h"
11 
12 /* Create (and allocate) a serial object for CK_ATTRIBUTE array */
13 CK_RV serialize_ck_attributes(struct serializer *obj,
14 			      CK_ATTRIBUTE_PTR attributes, CK_ULONG count);
15 
16 /* Convert PKCS11 TA attributes back to CK_ATTRIBUTE array */
17 CK_RV deserialize_ck_attributes(uint8_t *in,
18 				CK_ATTRIBUTE_PTR attributes, CK_ULONG count);
19 
20 /* Create (and allocate) a serial object for CK_MECHANISM array */
21 CK_RV serialize_ck_mecha_params(struct serializer *obj,
22 				CK_MECHANISM_PTR mechanisms);
23 #endif /*LIBCKTEEC_SERIALIZE_CK_H*/
24