KEYCTL(3)

πŸ“¦
version 1.6.3 Β· 2 versions
  • 1.6.3 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.6.1 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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:

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