gnutls_pkcs7_get_crt_raw(3)

✨ gnutls_pkcs7_get_crt_raw ✨

okay bestie, welcome to the gnutls manual page for gnutls_pkcs7_get_crt_raw(3) β€” yes the whole thing lives in section 3 of the gnutls manual and it is so ready for u πŸ’–


🌸 NAME 🌸

gnutls_pkcs7_get_crt_raw β€” it's an API function, periodt πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/pkcs7.h>

int gnutls_pkcs7_get_crt_raw(gnutls_pkcs7_t pkcs7, unsigned indx, void *
certificate, size_t * certificate_size);

like. look at her. iconic signature fr fr πŸ¦‹


πŸ’œ ARGUMENTS πŸ’œ

  • gnutls_pkcs7_t pkcs7 β€” bestie this one should contain a gnutls_pkcs7_t type. that's the whole vibe. πŸ‘‘
  • unsigned indx β€” this holds the index of the certificate u wanna extract, so like, which one are we pulling out 🫢
  • void * certificate β€” the contents of the certificate get copied right there into this bad boy (and yes, it may be null, no stress) ✨
  • size_t * certificate_size β€” this one should hold the size of the certificate, so keep it fed and happy πŸ“

🌈 DESCRIPTION 🌈

so basically?? this function will return a certificate of the PKCS7 or RFC2630 certificate set. that's it, that's the gig πŸ’–

and here's the lil plot twist: after the last certificate has been read, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. so when u hit that error, it's not a crisis, it's literally just the end of the list saying "that's all bestie, we're done here" 😭✨


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned, slay. otherwise u get a negative error value, sad but survivable πŸ’€

and ooooh important one: if the provided buffer is not long enough, then certificate_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER is returned. so like, she's telling u how much room she actually needs β€” read the number, grow ur buffer, try again, main character energy πŸ‘‘


πŸ› REPORTING BUGS πŸ›

found a bug? don't be shy, report bugs to <bugs@gnutls.org> 🫢

home page: 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. (yes u can share it, just keep the receipts, no cap πŸ’…)


πŸ”₯ 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/

ngl if u read all the way down here u are genuinely built different 🧚

okay bye ily, this was gnutls 3.8.13 and this page is gnutls_pkcs7_get_crt_raw(3) β€” go extract those certificates bestie πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from