shishi_asn1_read(3)

πŸ“¦
version 1.0.3 Β· 3 versions
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute

πŸ’– shishi_asn1_read πŸ’–

okay bestie, welcome to the shishi manual page for shishi_asn1_read(3) β€” yes it's a section 3 page, yes it's the shishi library, and yes we are gonna read it together like it's a group chat at 2am πŸ¦‹


✨ NAME ✨

shishi_asn1_read β€” it's an API function, that's literally the whole name, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <shishi.h>

int shishi_asn1_read(Shishi * handle, Shishi_asn1 node, const char *
field, char ** data, size_t * datalen);

there she is. the function. iconic. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • Shishi * handle β€” your shishi handle, the one you got from shishi_init(). it's giving main character energy, everything needs it.
  • Shishi_asn1 node β€” the ASN.1 variable you're reading a field from. the source. the origin story.
  • const char * field β€” the name of the field inside node that you wanna read. just tell it the name, it'll go find it.
  • char ** data β€” a newly allocated output buffer that will hold the ASN.1 field data. yes, newly allocated β€” you didn't make this, it made it for you 🫢
  • size_t * datalen β€” the actual size of that output buffer. the receipts, basically.

πŸ’« DESCRIPTION πŸ’«

so what it does: it extracts the data stored in an ASN.1 field and drops it into a newly allocated buffer. that's the vibe. that's the whole job. slay.

and here's the lil detail you do NOT wanna miss, bestie: the buffer will always be zero terminated β€” always, no cap. but datalen will not include that added zero. so like, the zero is there, it's just not counted. do not let that zero sneak into your length math, fr fr. 😭


⭐ RETURN VALUE ⭐

  • SHISHI_OK β€” we ate. everything worked, successful, periodt. πŸ’–
  • SHISHI_ASN1_NO_ELEMENT β€” the element does not exist. it's not there. it ghosted you. πŸ’€
  • SHISHI_ASN1_NO_VALUE β€” the field exists but it has no value. it's giving empty. 🫠
  • SHISHI_ASN1_ERROR β€” anything else went wrong, so like, otherwise. that's the catch-all, iykyk.

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? not me being the one to tell you, but β€” report bugs to <bug-shishi@gnu.org>. πŸ›

GNU Shishi home page: http://www.gnu.org/software/shishi/

General help using GNU software: http://www.gnu.org/gethelp/


Copyright Β© 2002-2022 Simon Josefsson.

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 bestie, keep the notice. it's the rules. respect the rules. πŸ’…)


🌈 SEE ALSO 🌈

the full documentation for shishi is maintained as a Texinfo manual. if the info and shishi programs are properly installed at your site, this command:

info shishi

should give you access to the complete manual. go read it, it's lowkey a whole experience. πŸ“–βœ¨


and that's the page!! this was shishi_asn1_read(3) from shishi version 1.0.3 β€” mwah, go read some ASN.1, you got this πŸŽ€πŸ¦‹πŸ’–