xref: /optee_os/ta/pkcs11/src/token_capabilities.h (revision 2c028fdebbedee91f88f6c5325b5064a124dfe46)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2017-2020, Linaro Limited
4  */
5 
6 #ifndef TOKEN_CAPABILITIES_H
7 #define TOKEN_CAPABILITIES_H
8 
9 #include <pkcs11_ta.h>
10 #include <stdbool.h>
11 #include <stdint.h>
12 
13 bool mechanism_flags_complies_pkcs11(uint32_t mechanism_type, uint32_t flags);
14 
15 bool mechanism_is_valid(enum pkcs11_mechanism_id id);
16 
17 #if CFG_TEE_TA_LOG_LEVEL > 0
18 const char *mechanism_string_id(enum pkcs11_mechanism_id id);
19 #endif
20 
21 uint32_t *tee_malloc_mechanism_list(size_t *out_count);
22 
23 uint32_t mechanism_supported_flags(enum pkcs11_mechanism_id id);
24 
25 static inline bool mechanism_is_supported(enum pkcs11_mechanism_id id)
26 {
27 	return mechanism_supported_flags(id) != 0;
28 }
29 
30 #endif /*TOKEN_CAPABILITIES_H*/
31