gnutls_x509_crt_get_pk_algorithm(3)

πŸ’– gnutls_x509_crt_get_pk_algorithm β€” the gnutls manual, bestie edition πŸ’–

okay so you're reading the gnutls manual page for gnutls_x509_crt_get_pk_algorithm(3) and honestly? iconic choice. let's get into it πŸŽ€


✨ NAME ✨

gnutls_x509_crt_get_pk_algorithm β€” it's an API function, bestie. that's the whole name. short, sweet, slays. πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_pk_algorithm(gnutls_x509_crt_t cert, unsigned
int * bits);

like yes, she takes two args and returns an int. we love a simple signature, no notes. πŸ¦‹


🫢 ARGUMENTS 🫢

  • gnutls_x509_crt_t cert β€” this one should contain a gnutls_x509_crt_t type. that's it, that's the vibe check. she's your certificate, hand her over. 🌈
  • unsigned int * bits β€” if bits is non null it's gonna hold the size of the parameters' in bits. so like, a pointer, and if you pass it she fills it in. ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

so what does she actually do? this function will return the public key algorithm of an X.509 certificate. periodt. πŸ”₯

and if bits is non null, it should have enough size to hold the parameters size in bits. important, don't skip this: for RSA the bits returned is the modulus. for DSA the bits returned are of the public exponent. different keys, different meanings, no cap. πŸ’€

unknown/unsupported algorithms are mapped to GNUTLS_PK_UNKNOWN. she doesn't guess, she doesn't improvise β€” she just says "idk her" and moves on. πŸ™ˆ


⭐ RETURNS ⭐

on success you get a member of the gnutls_pk_algorithm_t enumeration. πŸŽ‰

or, if things went sideways, a negative error code on error. so like, check your return value, bestie, don't just assume. 😭


πŸ’€ REPORTING BUGS πŸ’€

found something cursed? report bugs to <bugs@gnutls.org>.

home page: https://www.gnutls.org

they genuinely wanna hear about it, fr fr. 🫢


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 go forth and share, she's free 🌈✨


🧚 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 your girl, go read her. iykyk. πŸ’…


and that's the whole page, bestie β€” gnutls version 3.8.13, this manual page for gnutls_x509_crt_get_pk_algorithm(3), dated with all the love. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from