gnutls_fingerprint(3)

πŸ’– NAME πŸ’–

gnutls_fingerprint β€” an API function, bestie. It lives in the gnutls manual, section 3, and it's the one that does the hashing for you. πŸ‘‘


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int gnutls_fingerprint(gnutls_digest_algorithm_t algo, const
gnutls_datum_t * data, void * result, size_t * result_size);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_digest_algorithm_t algo β€” this is a digest algorithm. like, pick your fighter. πŸ’…
  • const gnutls_datum_t * data β€” this is the data. the actual stuff you wanna fingerprint.
  • void * result β€” this is the place where the result will be copied. and yes, it may be null 🫢
  • size_t * result_size β€” this one should hold the size of the result. and then β€” plot twist β€” the actual size of the returned result will also be copied there. so it's giving in-and-out, it's bidirectional, it's doing the most. 😭

🌸 DESCRIPTION 🌸

okay so. this function will calculate a fingerprint (actually a hash, let's be honest) of the given data. periodt.

and here's the thing β€” the result is not printable data. not even a little. so you should convert it to hex, or to something else printable. raw bytes are not the vibe for showing your friends, fr fr. πŸ”₯

this is the usual way to calculate a fingerprint of an X.509 DER encoded certificate. iconic behaviour. BUT β€” and this is the important part, do not skip this β€” the fingerprint of an OpenPGP certificate is not just a hash and cannot be calculated with this function. not me warning you before you go down that road. πŸ’€


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (which is 0, bestie) is returned. otherwise, an error code is returned. so like, check it. always check it. 🌈


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? spill the tea, but do it properly:


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, free free free, 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/

that's the plug. go read it. iykyk. πŸ“š


k bye bestie, this was gnutls version 3.8.13, gnutls_fingerprint(3), and you ATE this manual page. no cap. πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from