40 {0x92, 0xa0, 0x09, 0xa9, 0xf0, 0xd4, 0xca, 0xb8, 0x72, 0x0e, 0x82, 0x0b, 0x5f,
41 0x64, 0x25, 0x40, 0xa2, 0xb2, 0x7b, 0x54, 0x16, 0x50, 0x3f, 0x8f, 0xb3, 0x76,
42 0x22, 0x23, 0xeb, 0xdb, 0x69, 0xda, 0x08, 0x5a, 0xc1, 0xe4, 0x3e, 0x15, 0x99,
43 0x6e, 0x45, 0x8f, 0x36, 0x13, 0xd0, 0xf1, 0x1d, 0x8c, 0x38, 0x7b, 0x2e, 0xae,
44 0xb4, 0x30, 0x2a, 0xee, 0xb0, 0x0d, 0x29, 0x16, 0x12, 0xbb, 0x0c, 0x00};
46 0x5a, 0x92, 0xb7, 0x0a, 0xa7, 0x4d, 0x1b,
47 0x7e, 0xbc, 0x9c, 0x98, 0x2c, 0xcf, 0x2e,
48 0xc4, 0x96, 0x8c, 0xc0, 0xcd, 0x55, 0xf1,
49 0x2a, 0xf4, 0x66, 0x0c};
58 const char *connector_url;
60 connector_url = getenv(
"DEFAULT_CONNECTOR_URL");
61 if (connector_url == NULL) {
75 sizeof(password),
false, &
session);
85 printf(
"Successfully established session %02d\n", session_id);
92 size_t key_material_len =
sizeof(
key);
93 if (!
read_file(fp, key, &key_material_len)) {
97 &key_material_len,
false);
114 printf(
"Key imported with ID %04x\n",
key_id);
116 printf(
"Signing %zu bytes of data\n",
sizeof(data));
119 size_t signature_len =
sizeof(signature);
124 printf(
"Signature (%zu bytes) is:", signature_len);
125 for (
unsigned int i = 0; i < signature_len; i++) {
126 printf(
" %02x", signature[i]);
130 assert(signature_len == 64);
134 size_t public_key_len =
sizeof(public_key);
139 assert(public_key_len == 32);
142 printf(
"Public key (%zu bytes) is:", public_key_len);
143 for (
unsigned int i = 0; i < public_key_len; i++) {
144 printf(
" %02x", public_key[i]);
bool read_private_key(uint8_t *buf, size_t len, yh_algorithm *algo, uint8_t *bytes, size_t *bytes_len, bool internal_repr)
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_sign_eddsa(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
yh_rc yh_util_import_ed_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *k)