---
name: "cl_split"
section: "3"
platform: "linux"
package: "libcanlock-dev"
version: "3.3.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cl_split"
---

# cl\_split(3)

Split Cancel-Key or Cancel-Lock with libcanlock

## NAME

cl\_split - Split Cancel-Key or Cancel-Lock with libcanlock

## SYNOPSIS

```
#include <libcanlock-3/canlock.h>

cl_hash_version cl_split(char *input, char **klstring);
```

Possible return values (by version 3.0.0 of libcanlock):\
 CL\_INVALID CL\_SHA1 CL\_SHA224 CL\_SHA256 CL\_SHA384 CL\_SHA512

## DESCRIPTION

The **cl\_split**() function splits a \<c-key\> or \<c-lock\> element according to RFC 8315.

The hash algorithm for \<scheme\> is extracted and the corresponding ID is returned. If the hash algorithm is not found or not supported, CL\_INVALID is returned.

A pointer to the \<c-key-string\> or \<c-lock-string\> element respectively is written to *klstring* on success (points inside the string *input* and therefore no additional memory is allocated).\
 NULL is written to *klstring* on error.

## RETURN VALUE

Hash algorithm ID (CL\_INVALID on error).

## AUTHORS

Michael Baeuerle\
 (Based in part on **lock\_strip\_alpha()** written by G. J. Andruk for Version 2)

## REPORTING BUGS

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

## STANDARDS

**libcanlock** tries to comply with the following standards:

RFC 5537, RFC 6234, RFC 8315

## SEE ALSO

[**cl\_clear\_secret**(3)](/cl_clear_secret/3.md), [**cl\_get\_key**(3)](/cl_get_key/3.md), [**cl\_get\_lock**(3)](/cl_get_lock/3.md), [**cl\_verify**(3)](/cl_verify/3.md), [**cl\_verify\_multi**(3)](/cl_verify_multi/3.md), [**canlock**(1)](/canlock/1.md)
