gnutls_x509_cr...bject_unique_id(3)

πŸ’– gnutls_x509_crt_get_subject_unique_id(3) πŸ’–

okay bestie, gather round 🫢 this one lives in the gnutls manual (section 3, the library-functions girlies), and it's literally all about pulling one specific lil value out of a certificate. no cap.


✨ NAME ✨

gnutls_x509_crt_get_subject_unique_id β€” and yes it's an API function, we're fancy here πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_get_subject_unique_id(gnutls_x509_crt_t crt, char *
buf, size_t * buf_size);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crt_t crt β€” this is the certificate, she's holding the whole vibe ✨
  • char * buf β€” a memory buffer that you allocated, bestie. it's gonna hold the unique id when we're done with it.
  • size_t * buf_size β€” on the way in, this is how big your buffer is. on the way out? it's holding the actual size of the unique ID. it's giving "before and after" fr fr.

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this function does is extract the subjectUniqueID value (if it's even there πŸ‘€) for the certificate you handed it. that's it. that's the whole job. iconic.

now, if your user-allocated buffer is not large enough to hold the full subjectUniqueID, you're gonna get a GNUTLS_E_SHORT_MEMORY_BUFFER error back. but it's not a total loss because buf_size gets set to the actual length, so you know exactly how much room to make next time πŸ’–

⚠️ okay important lore time: this function had a bug prior to 3.4.8 that prevented the setting of NULL buf to discover the buf_size. so if you're out here using it safely with the older versions, buf has to be a valid buffer that can hold at least a single byte if buf_size is zero. like. one (1) byte minimum. don't skip that or you're gonna have a bad time 😭

⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success πŸŽ‰ β€” otherwise a negative error code, which is the universe's way of saying "not today, babe" πŸ’€


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? spill it 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. (so like, go off, 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/


and that's the whole page bestie, ate and left no crumbs πŸ’… this was gnutls 3.8.13, page gnutls_x509_cr...bject_unique_id(3), mwah 😘

πŸ“¦ where this page comes from