Provided by: libcanlock-dev_3.1.0-1_amd64
libcanlock - Create Cancel-Key
#include <libcanlock-3/canlock.h> char *cl_get_lock(cl_hash_version hash, const unsigned char *sec, size_t sec_len, const unsigned char *msg, size_t msg_len); Supported values for hash (by version 3.0.0 of libcanlock): CL_SHA1 CL_SHA224 CL_SHA256 CL_SHA384 CL_SHA512
The cl_get_lock() function creates a <c-lock> element according to RFC8315. The hash algorithm for <scheme> is selected with hash. The local secret is specified with sec (sec_len must be set to the length of sec). The Message-ID of the target article (the one for which the lock is intended) is specified with msg (msg_len must be set to the length of msg).
Upon successful completion a pointer to the result string is returned. Otherwise, NULL is returned. On success the caller is responsible to call free(3) for the pointer returned as result.
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 RFC6234
Report bugs to <mailto:email@example.com>.
libcanlock tries to comply with the following standards: RFC5537, RFC6234, RFC8315
free(3), clear_secret(3), cl_get_key(3), cl_split(3), cl_verify(3), canlock(1)