key_instantiate_and_link(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

key_instantiate_and_link β€” instantiate a key and link it into the keyring, periodt. πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

       int key_instantiate_and_link (struct key *key , const void *data ,
       size_t datalen , struct key *keyring , struct key *authkey );

πŸŽ€ ARGUMENTS πŸŽ€

  • key β€” the actual key you’re instantiating, bestie. πŸ”‘
  • data β€” the data to use to instantiate the keyring. ✨
  • datalen β€” the length of data, literally just how long it is. πŸ“
  • keyring β€” the keyring to create a link in on success (or NULL, no pressure). 🫢
  • authkey β€” the authorisation token permitting instantiation. Like the VIP pass, iykyk. 🎟️

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: you have a key chilling in the uninstantiated state, and this function instantiates it using the provided data. Slay. Then, if that works out, it links the key in to the destination keyring β€” but only if one is supplied. πŸŽ€

If it’s successful, 0 is returned, the authorisation token is revoked, and anyone waiting for the key is woken up. Iconic behaviour, no cap. 🌈

If the key was already instantiated, -EBUSY will be returned. Not me getting told β€œbusy” by the kernel πŸ’€ β€” anyway, that’s the rule.

🌈 SEE ALSO 🌈

The kernel file ./security/keys/key.c is where the magic lives, and these are the related besties:


source/version who? ./security/keys. date? October 2026. signed off by key_instantiate_and_link(9) β€” byeee, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from