key_instantiate_and_link(9)
π key_instantiate_and_link(9) β Kernel API Manual, but make it cute π
β¨ 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 ofdata, literally just how long it is. πkeyringβ the keyring to create a link in on success (orNULL, 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:
key_alloc(9)key_payload_reserve(9)key_reject_and_link(9)key_put(9)key_create_or_update(9)key_create(9)key_update(9)key_revoke(9)key_invalidate(9)generic_key_instantiate(9)register_key_type(9)unregister_key_type(9)
source/version who? ./security/keys. date? October 2026. signed off by key_instantiate_and_link(9) β byeee, bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms