KCAPI_AKCIPHER_INIT(3)

✨ KCAPI_AKCIPHER_INIT(3) ✨

okay bestie, we're in the libkcapi corner of the man pages, and this one is literally just about ✨manifesting✨ an asymmetric cipher handle. it's giving "step one of a whole ritual" energy and honestly? iconic. πŸ’…


🌸 NAME 🌸

kcapi_akcipher_init β€” initialize cipher handle πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int kcapi_akcipher_init(struct kcapi_handle ** handle,
                        const char * ciphername, uint32_t flags);

πŸ’– ARGUMENTS πŸ’–

  • handle β€” [out] the cipher handle, which gets filled in during the call. you hand over a pointer-to-pointer and it comes back with a whole personality 🫢
  • ciphername β€” [in] the kernel crypto API cipher name, exactly as it's specified in /proc/crypto. so like, go look at what's in there first, don't just freestyle it 😭
  • flags β€” [in] flags that specify the type of cipher handle you want. it's the vibe check for what kind of handle you're getting ✨

πŸ’œ DESCRIPTION πŸ’œ

so this function does the initialization of an asymmetric cipher handle and sets up the connection to the kernel. no cap, that's the whole job β€” it's the "hi bestie, we're linked now" moment. πŸ”₯

on success, a pointer to a kcapi_handle object is returned in *handle. and listen β€” once you've got that handle, you should call kcapi_akcipher_destroy afterwards to free the resources. it's the responsible thing, the main character thing, the cleanup after yourself thing. don't leave it hanging πŸ’€

it returns:

  • 0 upon success β€” slay ✨
  • -ENOENT β€” the algorithm is not available πŸ™ˆ
  • -EOPNOTSUPP β€” the AF_ALG family is not available πŸ’€
  • -EINVAL β€” the accept syscall failed 😭
  • -ENOMEM β€” the cipher handle cannot be allocated 🌧️

πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de> Author. 🫑


that's the whole page, bestie β€” go forth and initialize responsibly πŸ’–βœ¨

libkcapi Manual 1.5.0 Β· July 2025 β€” mwah, periodt. πŸ’…πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from