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 agnutls_psk_client_credentials_ttype, 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 eitherGNUTLS_PSK_KEY_RAWorGNUTLS_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 π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms