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 a gnutls_mac_algorithm_t
  • void * salt β€” the salt used for string to key. and listen, if it's non-NULL then salt_size is holding its size going in, okay? πŸ‘‘
  • unsigned int * salt_size β€” string to key salt size, the size of the above
  • unsigned int * iter_count β€” string to key iteration count
  • char ** 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 Β© 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