asn1_der_decoding2(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

πŸ’– NAME πŸ’–

asn1_der_decoding2 β€” it's an API function, bestie, and it's about to eat


✨ SYNOPSIS ✨

#include <libtasn1.h>

int asn1_der_decoding2(asn1_node * element, const void * ider, int *
       max_ider_len, unsigned int flags, char * errorDescription);

πŸŽ€ ARGUMENTS πŸŽ€

  • asn1_node * element β€” okay so this is a pointer to an ASN1 structure. like, the thing you're filling up. the vessel. the main character 🫢
  • const void * ider β€” the vector that's holding the DER encoding. your raw bytes, your source material, your moment πŸ’…
  • int * max_ider_len β€” pointer to an integer that tells you the max number of bytes that * ider is allowed to take up. and here's the cute part: the real size of the DER encoding gets handed back to you through this same pointer. she's giving in and out, versatility, iconic. ✨
  • unsigned int flags β€” the flags that control how the function behaves. the vibe-setters. no cap.
  • char * errorDescription β€” a null-terminated string that holds the details when something went wrong 😭. your little note explaining the drama.

🌸 DESCRIPTION 🌸

So basically: fill the structure * element with values from a DER encoding string. simple, clean, gorgeous. πŸ’–

⚠️ but listen β€” the structure has to have just been created with asn1_create_element(). brand new. fresh out the box. don't come in here with a used structure, that's not the move. πŸ™ˆ

If the ASN1_DECODE_FLAG_ALLOW_PADDING flag is set, then the function will straight up ignore padding after the decoded DER data. and once it returns successfully, * max_ider_len gets set to the number of bytes decoded. cute, informative, we love a receipt. 🧾✨

If the ASN1_DECODE_FLAG_STRICT_DER flag is set, then the function will not decode any BER-encoded elements. nope. not today. strict means strict, periodt. πŸ’…


πŸ”₯ RETURNS πŸ”₯

  • ASN1_SUCCESS β€” when the DER encoding is OK. slay, ate, no notes. πŸ‘‘
  • ASN1_ELEMENT_NOT_FOUND β€” when ELEMENT is NULL. yeah... that's on you bestie 😭
  • ASN1_TAG_ERROR or ASN1_DER_ERROR β€” when the DER encoding doesn't match the structure name. and heads up: * ELEMENT gets deleted in that case. gone. reduced to atoms. πŸ’€

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. fr fr, that's the whole deal β€” no royalty, just keep the notice. πŸ’œ


🌈 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, then this command:

info libtasn1

should give you access to the complete manual. iykyk πŸ¦‹

Or, as an alternative, you can obtain the manual from:

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

and that's the whole page, bestie 🫢 this one came to you from libtasn1 version 4.21.0, dated with love, signed off as asn1_der_decoding2(3) β€” mwah πŸ’…πŸ’–
πŸ“¦ where this page comes from