gnutls_pem_base64_decode2(3)
π gnutls_pem_base64_decode2 β bestie's guide to un-base64-ing your PEM β¨
okay so this page is from the gnutls manual (yes, the actual TLS library, she's iconic) and we're talking about gnutls_pem_base64_decode2(3). it's giving "I just want the raw bytes out of this PEM blob, please and thank you" π
πΈ NAME πΈ
gnutls_pem_base64_decode2 β literally just an API function, no cap π
β¨ SYNOPSIS β¨
#include <gnutls/gnutls.h>
int gnutls_pem_base64_decode2(const char * header, const gnutls_datum_t
* b64_data, gnutls_datum_t * result);
π«Ά ARGUMENTS π«Ά
const char * headerβ the PEM header you're hunting for, likeCERTIFICATEfor example. this is your vibe check label πconst gnutls_datum_t * b64_dataβ this is where the encoded data lives, she's holding all the secrets πgnutls_datum_t * resultβ the spot where the decoded data gets dropped off. main character energy goes here π¦
π DESCRIPTION π
so basically this function decodes the encoded data you handed it. the decoded data gets allocated, and then stored into result. it's giving "here's your stuff, freshly unpacked" π
if the header you passed is non null, this function goes searching for "-----BEGIN header" and decodes only that part. if you don't give it a header, it just decodes the first PEM packet it finds. lowkey convenient π
you should use gnutls_free() to free the returned data. do not ghost your memory management, bestie, she will come back for you π
also, fun history moment: prior to GnuTLS 3.4.0 this function was available under the name gnutls_pem_base64_decode_alloc(). there's a compatibility macro pointing to this function, so the old name still works. periodt β¨
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get an error code back. slay when it's zero, sad when it's not π
π SINCE π
3.4.0 β she's been around a minute, respect her π
π₯ REPORTING BUGS π₯
found a bug? report it to <bugs@gnutls.org>. they want to hear from you fr fr π
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, 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/
okay that's the whole page, you ate that π this was gnutls_pem_base64_decode2(3) from the gnutls manual, version 3.8.13. go decode something cute, and remember: free your data, love yourself π«Άβ¨
π¦ 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