asn1_der_decoding_element(3)

πŸ“¦
version 4.21.0 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

πŸ’– asn1_der_decoding_element(3) πŸ’–

okay bestie, welcome to the libtasn1 corner of the manual pages πŸŽ€ this one's called asn1_der_decoding_element, and yes it's an API function, no cap.


✨ NAME ✨

asn1_der_decoding_element β€” it's an API function, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <libtasn1.h>

int asn1_der_decoding_element(asn1_node * structure, const char *
elementName, const void * ider, int len, char * errorDescription);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • asn1_node * structure β€” a pointer to an ASN1 structure, like the lil container we're working with 🫢
  • const char * elementName β€” the name of the element you wanna fill, literally just the label bestie
  • const void * ider β€” a vector holding the DER encoding of the whole structure. the entire thing, not just a piece ✨
  • int len β€” how many bytes are in *der: der[0]..der[len-1], count them carefully πŸ’€
  • char * errorDescription β€” a null-terminated string that carries the details when something goes wrong 😭

πŸ’œ DESCRIPTION πŸ’œ

So here's the tea: this fills the element named ELEMENTNAME with the values from a DER encoding string. πŸ“

The structure has to have just been created β€” using the function asn1_create_element(). And the DER vector has to contain the encoding string of the whole STRUCTURE. Like, the entire thing. No crumbs. πŸ‘‘

⚠️ Heads up bestie: if an error pops off during the decoding procedure, the *STRUCTURE gets deleted and set equal to NULL. Gone. Poof. 😭
🚨 ALSO, super important: this function is deprecated and may just be an alias to asn1_der_decoding in future versions. Use asn1_der_decoding() instead, fr fr. πŸ’…

🌈 RETURNS 🌈

  • ASN1_SUCCESS β€” DER encoding is OK, we ate πŸ’–
  • ASN1_ELEMENT_NOT_FOUND β€” ELEMENT is NULL or elementName == NULL, oops πŸ™ˆ
  • ASN1_TAG_ERROR or ASN1_DER_ERROR β€” the DER encoding doesn't match the structure structure, and heads up, *ELEMENT gets deleted πŸ’€

Copyright Β© 2006-2025 Free Software Foundation, Inc..

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, they're being generous, iconic behaviour)


🌟 SEE ALSO 🌟

The full documentation for libtasn1 is maintained as a Texinfo manual. If the info and libtasn1 programs are properly installed at your site, the command

info libtasn1

should give you access to the complete manual. As an alternative you may obtain the manual from:

https://www.gnu.org/software/libtasn1/manual/

and that's the whole page, bestie!! πŸ’…βœ¨ this lil rewrite was brought to you by libtasn1 version 4.21.0, the asn1_der_decoding_element(3) era β€” go forth and decode responsibly, mwah πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from