void *output, size_t * output_size);
#define GNUTLS_PKCS11_TOKEN_HW 1
+#define GNUTLS_PKCS11_TOKEN_TRUSTED (1<<1) /* p11-kit trusted */
int gnutls_pkcs11_token_get_flags(const char *url, unsigned int *flags);
int gnutls_pkcs11_obj_list_import_url(gnutls_pkcs11_obj_t * p_list,
struct find_flags_data_st {
struct p11_kit_uri *info;
unsigned int slot_flags;
+ unsigned int trusted;
};
struct find_url_data_st {
}
/* found token! */
-
+ if (p11_kit_module_get_flags(sinfo->module) & P11_KIT_MODULE_TRUSTED)
+ find_data->trusted = 1;
+ else
+ find_data->trusted = 0;
find_data->slot_flags = info->sinfo.flags;
return 0;
* @flags: The output flags (GNUTLS_PKCS11_TOKEN_*)
*
* This function will return information about the PKCS 11 token flags.
- * The flags from the %gnutls_pkcs11_token_info_t enumeration.
+ *
+ * The supported flags are: %GNUTLS_PKCS11_TOKEN_HW and %GNUTLS_PKCS11_TOKEN_TRUSTED.
*
* Returns: %GNUTLS_E_SUCCESS (0) on success or a negative error code on error.
*
if (find_data.slot_flags & CKF_HW_SLOT)
*flags |= GNUTLS_PKCS11_TOKEN_HW;
+ if (find_data.trusted != 0)
+ *flags |= GNUTLS_PKCS11_TOKEN_TRUSTED;
+
return 0;
}