KEYCTL(3)
π KEYCTL(3) β Linux Key Management Calls π
okay bestie, sit down, we're talking about keyctl(3) β the manual page for all the keyctl_*() key management wrappers. yes it's a lot of functions. yes we're gonna get through them all. grab a boba π§
β¨ NAME β¨
keyctl_*() β key management function wrappers
πΈ DESCRIPTION πΈ
so the keyctl() system call is basically a multiplexor, right? one syscall, a whole bunch of key management functions hiding inside it. it's giving one girlboss, many jobs π
and the way you're supposed to use it is not by poking the raw syscall yourself β you go through the wrappers in the libkeyutils library. that's the move.
first, to get these functions compiled into your thing, include the keyutils header file:
#include <keyutils.h>
and then (this is the part everyone forgets, no cap) you gotta tell the linker to actually link the library in:
-lkeyutils
like, you can't just declare it and hope. the linker needs to know. π₯
π KEYCTL FUNCTIONS π
here's the whole squad, alphabetical, every single one of them, don't skip a single icon:
keyctl_assume_authority(3)keyctl_chown(3)keyctl_capabilities(3)keyctl_clear(3)keyctl_describe(3)keyctl_describe_alloc(3)keyctl_dh_compute(3)keyctl_dh_compute_alloc(3)keyctl_get_keyring_ID(3)keyctl_get_persistent(3)keyctl_get_security(3)keyctl_get_security_alloc(3)keyctl_instantiate(3)keyctl_instantiate_iov(3)keyctl_invalidate(3)keyctl_join_session_keyring(3)keyctl_link(3)keyctl_move(3)keyctl_negate(3)keyctl_pkey_decrypt(3)keyctl_pkey_encrypt(3)keyctl_pkey_query(3)keyctl_pkey_sign(3)keyctl_pkey_verify(3)keyctl_read(3)keyctl_read_alloc(3)keyctl_reject(3)keyctl_restrict_keyring(3)keyctl_revoke(3)keyctl_search(3)keyctl_session_to_parent(3)keyctl_set_reqkey_keyring(3)keyctl_set_timeout(3)keyctl_setperm(3)keyctl_unlink(3)keyctl_update(3)keyctl_watch_key(3)
thirty-seven of them, bestie. the way that's a whole roster π each one has its own page, go read them, i'll wait π«Ά
π UTILITY FUNCTIONS π
and then there's the little helper crew β not keyctl wrappers exactly, just useful lil guys doing useful lil things:
π¦ SEE ALSO π¦
go peek at these when you're done here:
lowkey if you're reading this whole page you're already doing better than 90% of people who just cargo-cult -lkeyutils into their Makefile and pray π
and that's the whole vibe check, bestie β¨ this page is from the Linux crew β source/version vibe is Linux, and it was dated 21 Feb 2014. iconic behavior, honestly. go forth and manage those keys ππ
π¦ where this page comes from
- alpine 3.22: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.23: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.24: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- arch rolling: keyutils 1.6.3-4 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: keyutils-libs-devel 1.6.3-5.el10 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: keyutils-libs-devel 1.6.3-1.el9 Β· GPLv2+ and LGPLv2+
- centos-stream 9: keyutils-libs-devel 1.6.3-1.el9 Β· GPLv2+ and LGPLv2+
- debian bookworm: libkeyutils-dev 1.6.3-2 Β· GPL-2.0-or-later
- debian trixie: libkeyutils-dev 1.6.3-6 Β· GPL-2.0-or-later
- fedora 43: keyutils-libs-devel 1.6.3-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: keyutils-libs-devel 1.6.3-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs-devel 1.6.3-7.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs-devel 1.6.3-7.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: keyutils 1.6.3
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu noble: libkeyutils-dev 1.6.3-3build1 Β· GPL-2.0-or-later
- ubuntu questing: libkeyutils-dev 1.6.3-6ubuntu2
- ubuntu resolute: libkeyutils-dev 1.6.3-6ubuntu3 Β· GPL-2.0-or-later
- ubuntu stonking: libkeyutils-dev 1.6.3-6ubuntu3 Β· GPL-2.0-or-later
- Copyright (C) 2010 Red Hat, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms