GNUTLS_PSK_SET_CLIENT_CREDENTIALS(3)

✨ gnutls_psk_set_client_credentials ✨

okay bestie, welcome to the gnutls manual page for gnutls_psk_set_client_credentials, aka the little function that hands your PSK client creds their whole identity. let's get into it πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_psk_set_client_credentials(gnutls_psk_client_credentials_t
res, const char * username, const gnutls_datum_t * key,
gnutls_psk_key_flags flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_psk_client_credentials_t res β€” this is a gnutls_psk_client_credentials_t type, and it's the lil container you're loading all this info into.
  • const char * username β€” the user's zero-terminated userid, iykyk.
  • const gnutls_datum_t * key β€” the user's key, bestie. that's the secret sauce πŸ”‘
  • gnutls_psk_key_flags flags β€” tells everyone what format the key is in, and it's either GNUTLS_PSK_KEY_RAW or GNUTLS_PSK_KEY_HEX. no third option, periodt.

πŸ’– DESCRIPTION πŸ’–

so this function sets the username and password inside a gnutls_psk_client_credentials_t type. those two things are gonna get used in PSK authentication, so like... they matter, okay? πŸ‘‘

the username should be an ASCII string or a UTF-8 string. and if it's a UTF-8 string, it's recommended that it follows the PRECIS framework for usernames (rfc8265). yes, that's a real thing, and yes, you should care. 🌈

the key can be either in raw byte format or in Hex format β€” and not me reminding you that the Hex version has no 0x prefix. do not add the 0x. i'm serious. πŸ’€


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get an error code back, and honestly? that error code is just the universe telling you to read it. πŸ™ˆ


πŸ¦‹ REPORTING BUGS πŸ¦‹

found a bug? spill the tea to bugs@gnutls.org, they wanna know fr fr.

home page, if you're feeling curious: 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. slay, honestly. that's the whole vibe. 🫢


🌟 SEE ALSO 🌟

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

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


and that's the page, bestie!! πŸ’–βœ¨ this one's from gnutls version 3.8.13 β€” go forth and set those client credentials, you main character πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from