gnutls_verify_stored_pubkey(3)
π gnutls_verify_stored_pubkey β the vibe check for stored public keys π
okay bestie, welcome to the gnutls manual, page gnutls_verify_stored_pubkey(3). this one's an API function and it's literally here to answer one question: do i already know this key, or is this a stranger? π΅οΈβοΈβ¨
πΈ NAME πΈ
gnutls_verify_stored_pubkey β API function. that's it, that's the name, she's giving utility icon π
π SYNOPSIS π
#include <gnutls/gnutls.h>
int gnutls_verify_stored_pubkey(const char * db_name, gnutls_tdb_t tdb,
const char * host, const char * service, gnutls_certificate_type_t
cert_type, const gnutls_datum_t * cert, unsigned int flags);
look at that signature. seven whole arguments. she's high maintenance but she's worth it π«Ά
β¨ ARGUMENTS β¨
const char * db_nameβ a file specifying the stored keys. passNULLand you get the default one, no big deal πβοΈgnutls_tdb_t tdbβ a storage structure, orNULLto use the default. yes you can bring your own, we love a custom setup π₯const char * hostβ the peer's name. who are we even talking to rn πconst char * serviceβ non-NULLif this key is specific to a service (e.g.http). very "this key has a job" energy πΌgnutls_certificate_type_t cert_typeβ the type of the certificate. gotta label your cert bestie, no mystery boxes π¦const gnutls_datum_t * certβ the raw (der) data of the certificate. raw, unfiltered, der-encoded, iconic πunsigned int flagsβ should be0. that's it. zero. nothing else. don't get creative, she said what she said π
π« DESCRIPTION π«
so what does this function actually DO. bestie, it will try to verify a raw public-key, or a public-key that came to you via a raw (DER-encoded) certificate, using a list of stored public keys. basically: cross-referencing the group chat receipts πβ¨
heads up: the service field, if it's non-NULL, should be a port number. not vibes. a number. π’
the db_name variable, if it's non-null, specifies a custom backend for the retrieval of entries. if it's NULL, the default file backend gets used. and on POSIX-like systems that file backend is literally the $HOME/.gnutls/known_hosts file. yes, same energy as your ssh known_hosts, she's not new here π
now the important part, and i need you to actually read this one: if a custom storage backend is provided, the retrieval function should return GNUTLS_E_CERTIFICATE_KEY_MISMATCH if the host/service pair is found but the key doesn't match, GNUTLS_E_NO_CERTIFICATE_FOUND if no such host/service with the given key is found, and 0 if it was found. the storage function should return 0 on success. like, that's the contract, that's the whole deal, no negotiating π€
and as of GnuTLS 3.6.6, this function also verifies raw public keys. glow-up era fr fr β
π RETURNS π
- no associated public key found? you're getting
GNUTLS_E_NO_CERTIFICATE_FOUND. she doesn't know them π - key found but it does NOT match?
GNUTLS_E_CERTIFICATE_KEY_MISMATCH. red flag, block them π© - on success,
GNUTLS_E_SUCCESS(0) is returned. slay π - or a negative error value on other errors. yeah, sometimes life is like that π
π¦ SINCE π¦
3.0.13 β an elder, a legend, been here since forever π
π REPORTING BUGS π
found a bug? do NOT suffer in silence bestie, tell someone. report bugs to <bugs@gnutls.org>.
home page: 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. so like, share it, remix it, just 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/
go read it, it's giving scholarly π§
and that's the whole page, bestie. no cap, every flag, every return value, every file path β all accounted for π
this was gnutls version 3.8.13, gnutls_verify_stored_pubkey(3), and yes it's a whole 3.8.13 situation. mwah, stay verified β¨π
π
π¦ 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