29#ifndef DEFAULT_CONNECTOR_URL
30#define DEFAULT_CONNECTOR_URL "http://127.0.0.1:12345"
44 const char *connector_url;
46 connector_url = getenv(
"DEFAULT_CONNECTOR_URL");
47 if (connector_url == NULL) {
71 printf(
"Successfully established session %02d using Authentication Keys "
90 printf(
"Imported Authentication Key with ID %04x\n",
key_id);
98 printf(
"Closed session %02d\n", session_id);
110 printf(
"Successfully established session %02d using Authentication Key "
114 printf(
"Trying to get 16 bytes of random data\n");
117 size_t data_len =
sizeof(data);
CK_SESSION_HANDLE session
const uint8_t password2[]
#define DEFAULT_CONNECTOR_URL
const uint8_t password1[]
const char * yh_strerror(yh_rc err)
Capabilities representation.
yh_rc yh_destroy_session(yh_session **session)
yh_rc yh_create_session_derived(yh_connector *connector, uint16_t authkey_id, const uint8_t *password, size_t password_len, bool recreate, yh_session **session)
yh_rc yh_util_close_session(yh_session *session)
yh_rc yh_authenticate_session(yh_session *session)
yh_rc yh_util_import_authentication_key_derived(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, const yh_capabilities *delegated_capabilities, const uint8_t *password, size_t password_len)
yh_rc yh_string_to_domains(const char *domains, uint16_t *result)
yh_rc yh_init_connector(const char *url, yh_connector **connector)
yh_rc yh_connect(yh_connector *connector, int timeout)
yh_rc yh_string_to_capabilities(const char *capability, yh_capabilities *result)
yh_rc yh_disconnect(yh_connector *connector)
yh_rc yh_get_session_id(yh_session *session, uint8_t *sid)
yh_rc yh_util_get_pseudo_random(yh_session *session, size_t len, uint8_t *out, size_t *out_len)
@ YHR_DEVICE_INSUFFICIENT_PERMISSIONS
Return value when the permissions to perform the operation are wrong.
@ YHR_GENERIC_ERROR
Return value when encountering an unknown error.
@ YHR_SUCCESS
Returned value when function was successful.
yh_capabilities capabilities