gnutls_pkcs12_mac_info(3)
π NAME π
gnutls_pkcs12_mac_info β it's an API function, bestie, and it's here to spill the tea on the MAC inside your PKCS 12 structure π
This page lives in the gnutls manual, and honestly? She's a whole vibe.
β¨ SYNOPSIS β¨
#include <gnutls/pkcs12.h>
int gnutls_pkcs12_mac_info(gnutls_pkcs12_t pkcs12, unsigned int * mac,
void * salt, unsigned int * salt_size, unsigned int * iter_count, char
** oid);
π«Ά ARGUMENTS π«Ά
gnutls_pkcs12_t pkcs12β a pkcs12 type. yeah. that's the thing you're interrogating πunsigned int * macβ the MAC algorithm that got used, handed back to you as agnutls_mac_algorithm_tvoid * saltβ the salt used for string to key. and listen, if it's non-NULL thensalt_sizeis holding its size going in, okay? πunsigned int * salt_sizeβ string to key salt size, the size of the aboveunsigned int * iter_countβ string to key iteration countchar ** oidβ if this is non-NULL, it's gonna get an allocated null-terminated variable with the OID in it. iconic.
πΈ DESCRIPTION πΈ
okay so, bestie, this function hands you the deets on the MAC algorithm used inside a PKCS 12 structure. lowkey useful, highkey specific.
Now here's the part you need to really clock: if the structure's algorithms are unknown, you get GNUTLS_E_UNKNOWN_HASH_ALGORITHM back β and only oid gets set. that's it. that's the whole story.
Which means: oid will be set on structures with a MAC, whether that MAC is supported or not. supported or not, she's showing up. periodt. π
But you must deinitialize it using gnutls_free(). don't forget, i'm begging π₯Ί
The other variables? They're the picky ones. They only get set on structures that are actually supported. not me gatekeeping info but ok.
π₯ RETURNS π₯
GNUTLS_E_INVALID_REQUESTβ if the structure you handed over doesn't contain a MAC. no MAC, no service π«GNUTLS_E_UNKNOWN_HASH_ALGORITHMβ if the structure's MAC isn't supported. we don't know her π- or another negative error code in case of a failure, the classic π
- Zero on success. zero is the slay. β¨
π REPORTING BUGS π
Found something cursed? Report bugs to <bugs@gnutls.org>. they wanna hear it 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. (basically: 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!! this one's from gnutls version 3.8.13, page gnutls_pkcs12_mac_info(3) β stay hydrated, free your oid, and go read some PKCS 12s π
β¨π
π¦ 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