gnutls_pubkey_import(3)

πŸ’– gnutls_pubkey_import(3) πŸ’–

okay bestie, welcome to the gnutls manual page for gnutls_pubkey_import β€” yes it's an API function, yes it's iconic, and yes we're gonna get you fluent in it in like two minutes. grab a boba. πŸ§‹βœ¨


🌸 NAME 🌸

gnutls_pubkey_import β€” literally an API function, that's the whole name, she's simple like that πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/abstract.h>

int gnutls_pubkey_import(gnutls_pubkey_t key, const gnutls_datum_t *
data, gnutls_x509_crt_fmt_t format);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_pubkey_t key β€” the public key. this is the glow-up destination, the main character that's gonna hold your imported key πŸ’–
  • const gnutls_datum_t * data β€” the DER or PEM encoded certificate. yes girl, that blob right there 🫢
  • gnutls_x509_crt_fmt_t format β€” one of DER or PEM. pick your fighter, no third option, periodt ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: this function imports the public key you hand it β€” one that's sitting in a SubjectPublicKeyInfo X.509 structure β€” and turns it into a native gnutls_pubkey_t type. it's giving ✨transformation✨

the output gets stored in key, bestie. that's where it lives now. 🏠

and lowkey important: if your public key is PEM encoded, it should have a header of "PUBLIC KEY". like, that exact header. no cap. if it doesn't, that's a you problem and the function will be like 🧍


πŸ”₯ RETURNS πŸ”₯

on success, GNUTLS_E_SUCCESS (0) is returned. slay! πŸŽ‰

otherwise you get a negative error value. not slay. 😭 but at least you know it went wrong instead of just. vibing mysteriously.


πŸ‘‘ SINCE πŸ‘‘

2.12.0 β€” she's been around, she's a legacy icon, she ate and left no crumbs 🌈


πŸ’€ REPORTING BUGS πŸ’€

found a bug? not me fr fr. 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. so like, go off, but keep the receipts πŸ’œ


🌈 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/

that's the whole page bestie, you understood it, i'm so proud of you πŸ₯ΉπŸ«Ά

this has been gnutls_pubkey_import(3), from the gnutls manual, version 3.8.13 β€” mwah, go import some keys, love u πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from