libcanlock(3)

πŸŽ€ NAME πŸŽ€

cl_verify β€” check whether key and lock strings match with libcanlock. Hiii bestie, welcome to the libcanlock(3) manual β€” this one is short, sweet, and lowkey iconic πŸ’–


✨ SYNOPSIS ✨

#include <libcanlock-3/canlock.h>

int cl_verify(cl_hash_version hash,
              const char *c_key_string, const char *c_lock_string);

Supported values for hash (by version 3.0.0 of libcanlock): CL_SHA1 CL_SHA224 CL_SHA256 CL_SHA384 CL_SHA512 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so cl_verify() is the function that checks whether a <c-key-string> and a <c-lock-string> element match or not, according to RFC 8315. No cap, that’s the whole main-character job πŸ’…

The hash algorithm for <scheme> is selected with hash.

The <c-key-string> element is specified with c_key_string, and the <c-lock-string> element with c_lock_string.

If you need to pull <c-key-string> out of <c-key> (or <c-lock-string> out of <c-lock>, respectively) elements, the function cl_split() can be used for that 🫢

Also: consider the function cl_verify_multi() to check multiple keys against multiple locks. It’s literally right there for that exact vibe πŸ‘‘


πŸ’… RETURN VALUE πŸ’…

Upon successful completion, zero is returned. ✨

All other values indicate an error. 😭 So like, if it’s not zero, something went sideways.


🌸 AUTHORS 🌸

Shoutout to the icons who made this happen:

  • Dennis Preiser (Based in part on the implementation from G. J. Andruk for Version 2)
  • The base64 implementation is written by Kungliga Tekniska Hogskolan (Royal Institute of Technology, Stockholm, Sweden)
  • The hash algorithms are implemented with code from RFC 6234

πŸ› REPORTING BUGS πŸ›

Report bugs to <mailto:michael.baeuerle@gmx.net>.


🧚 STANDARDS 🧚

libcanlock tries to comply with the following standards:


πŸ”₯ SEE ALSO πŸ”₯

cl_clear_secret(3), cl_get_key(3), cl_get_lock(3), cl_split(3), cl_verify_multi(3), cl_hp_get_field(3), cl_hp_unfold_field(3), cl_hp_parse_field(3), canlock(1), canlock-hfp(1), canlock-mhp(1).


That’s the whole manual page, bestie! It’s from the libcanlock 3.3.3 manual, dated 2026-07-06, Unix edition β€” slay and stay hydrated πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from