.TH "auth.h" 3 "Bark" \" -*- nroff -*- .ad l .nh .SH NAME auth.h \- Bark WebAuthn passkey registration and assertion primitives\&. .SH SYNOPSIS .br .PP .SS "Classes" .in +1c .ti -1c .RI "struct \fBbark_auth_result_t\fP" .br .RI "Parsed WebAuthn registration or assertion result\&. " .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct bark_auth \fBbark_auth_t\fP" .br .RI "Opaque passkey vault handle\&. " .ti -1c .RI "typedef void(* \fBbark_auth_cb_fn\fP) (void *user, int ok, int is_register, const char *json_or_err)" .br .RI "Completion callback for asynchronous passkey ceremonies\&. " .ti -1c .RI "typedef void(* \fBbark_auth_bool_cb_fn\fP) (void *user, int ok)" .br .RI "Completion callback for boolean capability probes\&. " .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBbark_auth_err_t\fP { \fBBARK_AUTH_ERR_OK\fP = 0, \fBBARK_AUTH_ERR_UNAVAILABLE\fP, \fBBARK_AUTH_ERR_CANCELED\fP, \fBBARK_AUTH_ERR_NO_CREDENTIAL\fP, \fBBARK_AUTH_ERR_BUSY\fP, \fBBARK_AUTH_ERR_FAILED\fP }" .br .RI "Normalized WebAuthn ceremony error codes\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBbark_auth_t\fP * \fBbark_auth_create\fP (const char *store_path)" .br .RI "Open or create a passkey vault backed by \fRstore_path\fP (ignored on WASM)\&. " .ti -1c .RI "void \fBbark_auth_destroy\fP (\fBbark_auth_t\fP *auth)" .br .RI "Destroy a passkey vault handle\&. " .ti -1c .RI "int \fBbark_auth_create_passkey_json\fP (\fBbark_auth_t\fP *auth, const char *challenge, const char *rp_id, const char *origin, const char *user_id, const char *name, char *out_json, size_t out_cap)" .br .RI "Synchronously register a P-256 passkey and serialize the response JSON into \fRout_json\fP\&. " .ti -1c .RI "int \fBbark_auth_get_assertion_json\fP (\fBbark_auth_t\fP *auth, const char *challenge, const char *rp_id, const char *origin, char *out_json, size_t out_cap)" .br .RI "Synchronously sign a WebAuthn assertion and serialize the response JSON into \fRout_json\fP\&. " .ti -1c .RI "int \fBbark_auth_verify_assertion\fP (const char *spki_b64u, const char *rp_id, const char *auth_data_b64u, const char *client_data_b64u, const char *sig_b64u)" .br .RI "Verify an ES256 WebAuthn assertion offline against a base64url SPKI public key\&. " .ti -1c .RI "int \fBbark_auth_rp_id_from_origin\fP (const char *origin, char *out, size_t cap)" .br .RI "Extract the relying-party hostname (\fRrpId\fP) from an origin URL such as \fR"https://host:8443/path"\fP\&. " .ti -1c .RI "int \fBbark_auth_parse_result\fP (int ok, int is_register, const char *json_or_err, \fBbark_auth_result_t\fP *out)" .br .RI "Parse a raw \fBbark_auth_cb_fn\fP callback payload into \fBbark_auth_result_t\fP\&. " .ti -1c .RI "void \fBbark_auth_create_passkey_async\fP (\fBbark_auth_t\fP *auth, const char *challenge, const char *rp_id, const char *origin, const char *user_id, const char *name, \fBbark_auth_cb_fn\fP cb, void *user)" .br .RI "Start an asynchronous passkey registration ceremony (isomorphic native + browser WASM)\&. " .ti -1c .RI "void \fBbark_auth_get_assertion_async\fP (\fBbark_auth_t\fP *auth, const char *challenge, const char *rp_id, const char *origin, \fBbark_auth_cb_fn\fP cb, void *user)" .br .RI "Start an asynchronous passkey assertion ceremony (isomorphic native + browser WASM)\&. " .ti -1c .RI "int \fBbark_auth_passkey_supported\fP (void)" .br .RI "Return non-zero if WebAuthn / passkeys are supported in this runtime\&. " .ti -1c .RI "void \fBbark_auth_platform_available_async\fP (\fBbark_auth_t\fP *auth, \fBbark_auth_bool_cb_fn\fP cb, void *user)" .br .RI "Asynchronously probe whether a platform (built-in) passkey authenticator is available\&. " .in -1c .SH "Detailed Description" .PP Bark WebAuthn passkey registration and assertion primitives\&. Headless WebAuthn / FIDO2 passkey authentication (ES256 P-256)\&. .PP Provides identical passkey registration and assertion flows across native desktop hosts (local encrypted software passkey store) and browser WASM (\fRnavigator\&.credentials\&.create\fP / \fRnavigator\&.credentials\&.get\fP)\&. .SH "Typedef Documentation" .PP .SS "typedef void(* bark_auth_cb_fn) (void *user, int ok, int is_register, const char *json_or_err)" .PP Completion callback for asynchronous passkey ceremonies\&. Pass the raw parameters directly to \fBbark_auth_parse_result()\fP to unpack structured fields and normalized error codes\&. .SH "Enumeration Type Documentation" .PP .SS "enum \fBbark_auth_err_t\fP" .PP Normalized WebAuthn ceremony error codes\&. .PP \fBEnumerator\fP .in +1c .TP \f(BIBARK_AUTH_ERR_OK \fP Ceremony succeeded\&. .TP \f(BIBARK_AUTH_ERR_UNAVAILABLE \fP WebAuthn is unavailable in this runtime\&. .TP \f(BIBARK_AUTH_ERR_CANCELED \fP User canceled or browser rejected prompt\&. .TP \f(BIBARK_AUTH_ERR_NO_CREDENTIAL \fP No stored passkey matched the relying party\&. .TP \f(BIBARK_AUTH_ERR_BUSY \fP Too many concurrent auth requests in flight\&. .TP \f(BIBARK_AUTH_ERR_FAILED \fP Cryptographic, I/O, or generic ceremony failure\&. .SH "Author" .PP Generated automatically by Doxygen for Bark from the source code\&.