38 {
42
44
45 const char *connector_url;
46
47 connector_url = getenv("DEFAULT_CONNECTOR_URL");
48 if (connector_url == NULL) {
50 }
51
54
57
60
64
67
71
72 printf(
"Successfully established session %02d using Authentication Key "
73 "%04x\n",
74 session_id, authkey);
75
79
83
90
91 printf(
"Imported Authentication Key with ID %04x and password \"%s\"\n",
93
97
98 printf(
"Unable to change Authentication Key with ID %04x from this session\n",
100
103
106
107 printf(
"Closed session %02d\n", session_id);
108
112
115
118
119 printf(
"Successfully established session %02d using Authentication Key "
120 "%04x\n",
122
126
127 printf(
"Successfully changed Authentication Key with ID %04x to password "
128 "\"%s\"\n",
130
133
136
137 printf(
"Closed session %02d\n", session_id);
138
142
143 printf(
"Unable to open session with Authentication Key %04x and password "
144 "\"%s\"\n",
146
149
153
156
159
160 printf(
"Successfully established session %02d using Authentcation Key %04x "
161 "and password \"%s\"\n",
163
166
169
172
175
176 return 0;
177}
const uint8_t password2[]
#define DEFAULT_CONNECTOR_URL
const uint8_t password1[]
const uint8_t password3[]
CK_SESSION_HANDLE session
LOGGING_API void printf(Category category, const char *format,...)
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_util_change_authentication_key_derived(yh_session *session, uint16_t *key_id, 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)
@ YHR_GENERIC_ERROR
Return value when encountering an unknown error.
@ YHR_SUCCESS
Returned value when function was successful.
@ YHR_DEVICE_INVALID_ID
Return value when an invalid Object ID is used.
@ YHR_CRYPTOGRAM_MISMATCH
Returned value when failing to verify cryptogram.
yh_capabilities capabilities