asn1_decode_simple_der(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_decode_simple_der πŸ’–

okay bestie, so this is a page from the libtasn1 manual β€” the asn1_decode_simple_der(3) one β€” and honestly? it's short, it's sweet, and it does exactly one thing. let's get into it πŸ¦‹


✨ NAME ✨

asn1_decode_simple_der β€” an API function, periodt. that's the whole name, no notes πŸ’…


✨ SYNOPSIS ✨

#include <libtasn1.h>

int asn1_decode_simple_der(unsigned int etype, const unsigned char *
der, unsigned int _der_len, const unsigned char ** str, unsigned int *
str_len);

like, look at that signature. five whole arguments. she's got range πŸ‘‘


✨ ARGUMENTS ✨

  • unsigned int etype β€” the type of the string to be encoded, and it's one of the ASN1_ETYPE_ ones. the vibe check on what kind of thing you're dealing with πŸ’«
  • const unsigned char * der β€” the encoded string itself. the actual bytes, the real deal, no cap.
  • unsigned int _der_len β€” how many bytes are in that encoded string. count 'em πŸ“
  • const unsigned char ** str β€” a pointer to the data. she points at the goods 🫢
  • unsigned int * str_len β€” the length of the data. the numbers, the receipts 🧾

✨ DESCRIPTION ✨

so what does she do? she decodes a simple DER encoded type β€” think a string, something that is not constructed, i.e. not a nested little matryoshka doll of other things, just one flat simple thing 🌸

and here's the important part, bestie: the output is a pointer inside the der. not a copy. not a new buffer. she's pointing into your original data. so do NOT go freeing that der and then wondering why everything's broken 😭

✨ RETURNS ✨

she gives you ASN1_SUCCESS if it worked, or an error value if it didn't. that's it. slay or flop, no in-between ✨


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

and the legal tea: 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. so like, take her, remix her, just keep the receipts πŸŽ€


✨ SEE ALSO ✨

the full documentation for libtasn1 is maintained as a Texinfo manual (yes, Texinfo, iconic of her πŸ’œ). if the info and libtasn1 programs are properly installed at your site, this command:

info libtasn1

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

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

iykyk πŸ”₯


and that's the whole page, bestie!! this was libtasn1, version 4.21.0, and the page is asn1_decode_simple_der(3). go decode something simple, stay unconstructed, and don't forget the pointer is inside the buffer πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from