gnutls_pkcs12_bag_set_key_id(3)

πŸ’– gnutls_pkcs12_bag_set_key_id πŸ’–

okay so bestie, welcome to the gnutls manual β€” yes that gnutls, the crypto library, and yes we're about to make a PKCS#12 bag glow up. this page is literally called gnutls_pkcs12_bag_set_key_id, and it's an API function, so grab a strawberry πŸ“ and let's go.


✨ NAME ✨

gnutls_pkcs12_bag_set_key_id β€” API function. that's it, that's the name, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs12.h>

int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, unsigned indx,
const gnutls_datum_t * id);

like, look at her. iconic signature. #include <gnutls/pkcs12.h> and you're in. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_pkcs12_bag_t bag β€” the bag. yes, a literal bag, we love a container moment. it's the bag. πŸ‘‘
  • unsigned indx β€” which element of the bag we're adding the id to. the bag's element to add the id, fr fr.
  • const gnutls_datum_t * id β€” the ID. that's the whole description, no cap. πŸ’–

🌈 DESCRIPTION 🌈

so here's the tea: this function will add the given key ID to the bag element you picked, the one specified by the index. 🫢

the key ID gets encoded as a 'Local key identifier' bag attribute β€” which, lowkey, is the whole point, because that attribute is usually used to distinguish the local private key and the certificate pair. iykyk. πŸ”₯

so like, private key on one side, cert on the other, and this lil attribute is how you tell them apart. main character energy for an attribute honestly.


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. slay. βœ…

otherwise you get a negative error value. or a negative error code on error. 😭 yeah it says both, and we're keeping both, don't @ me.

ngl bestie: if it's negative, something went wrong. check it. always check it.

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? not me being shocked 😭 report it to <bugs@gnutls.org>.

home page: https://www.gnutls.org


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. periodt. πŸ’…


🧚 SEE ALSO 🧚

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


okay that's the whole page, you ate that. go forth and set those key IDs. πŸ¦‹βœ¨

signing off from the gnutls manual, version 3.8.13, page gnutls_pkcs12_bag_set_key_id(3) β€” mwah, bye bestie πŸ’–πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from