gnutls_pcert_import_rawpk_raw(3)

πŸ’– gnutls_pcert_import_rawpk_raw(3) πŸ’–

okay bestie, welcome to the gnutls manual, and specifically to gnutls_pcert_import_rawpk_raw(3) β€” yes the name is a mouthful, no we are not changing it, it's iconic actually. πŸŽ€


✨ NAME ✨

gnutls_pcert_import_rawpk_raw β€” API function πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_pcert_import_rawpk_raw(gnutls_pcert_st * pcert, const
gnutls_datum_t * rawpubkey, gnutls_x509_crt_fmt_t format, unsigned int
key_usage, unsigned int flags);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_pcert_st * pcert β€” the pcert structure you're importing the data into. it's the destination, the main character's dressing room fr.
  • const gnutls_datum_t * rawpubkey β€” the raw public-key, in gnutls_datum_t format, that's getting imported. 🫢
  • gnutls_x509_crt_fmt_t format β€” the format of that raw public-key. so like. DER or PEM. pick one bestie.
  • unsigned int key_usage β€” an ORed sequence of GNUTLS_KEY_* flags. yes, ORed, stack 'em up. πŸ”₯
  • unsigned int flags β€” zero for now. literally zero. that's the whole vibe. πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

so this convenience function will import β€” i.e. convert β€” the given raw public key rawpubkey into a gnutls_pcert_st structure. it's giving glow-up, it's giving transformation. ✨

lowkey important: that structure must be deinitialized afterwards using gnutls_pcert_deinit(). don't just leave it there, that's not the move. 😭

also note that the caller is responsible for freeing rawpubkey. yes YOU. it's you. all the necessary values will be copied into pcert though, so at least that part's handled. πŸŽ€

Key usage (as defined by X.509 extension (2.5.29.15)) can be explicitly set because there is no certificate structure around the key to define this value. like, the key is out here raw and unbothered, no cert wrapper, no nothing. πŸ¦‹ see gnutls_x509_crt_get_key_usage() for more info.


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so if it's negative... yeah. not slay. πŸ’…


🌈 SINCE 🌈

3.6.6


πŸŽ€ REPORTING BUGS πŸŽ€

found a bug? spill. report bugs 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 bestie, you ate that. this was brought to you by gnutls version 3.8.13, and honestly? she's serving. go forth and import those raw public keys responsibly, mwah πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from