Are you aware of the kernel keyring and the keyctl API? I've always been curious why more programs don't use it, I guess it's not the most ergonomic API and doesn't have many language bindings.
https://man7.org/linux/man-pages/man2/keyctl.2.html
AFAIU from the post itself it seems the main problem is, that the kernel keyring API doesn't implement persistence, so it can be used to implement high level key-rings, but it is not enough by itself.