+ client_key = lib->creds->create(lib->creds, CRED_PRIVATE_KEY,
+ KEY_ANY,
+ BUILD_FROM_FILE, client_key_file,
+ BUILD_END);
+ if (!client_key)
+ {
+ DBG1(DBG_APP, "loading client private key '%s' failed",
+ client_key_file);
+ goto end;
+ }
+ }
+ else /* attach old client private key object */
+ {
+
+ handle = chunk_from_hex(chunk_create(keyid, strlen(keyid)), NULL);
+ client_key = lib->creds->create(lib->creds, CRED_PRIVATE_KEY,
+ KEY_ANY,
+ BUILD_PKCS11_KEYID, handle,
+ BUILD_END);
+ chunk_free(&handle);
+ if (!client_key)
+ {
+ DBG1(DBG_APP, "attaching to private key handle %s failed",
+ keyid);
+ goto end;
+ }