asn1_length_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

πŸ’– NAME πŸ’–

asn1_length_der β€” bestie, it's an API function ✨


🌸 SYNOPSIS 🌸

#include <libtasn1.h>

void asn1_length_der(unsigned long int len, unsigned char * der, int *
der_len);

πŸŽ€ ARGUMENTS πŸŽ€

  • unsigned long int len β€” the value you wanna convert, periodt. πŸ’…
  • unsigned char * der β€” the buffer that's gonna hold the returned encoding (and lowkey it's allowed to be NULL).
  • int * der_len β€” how many meaningful bytes of ANS, aka der[0]..der[der_len-1]. πŸ¦‹

✨ DESCRIPTION ✨

Okay so what this does: it creates the DER encoding of the length value you hand it. That's the whole vibe. 🫢

Real talk though β€” your der buffer has to have enough room for the output. Like, no cap, it will not grow itself for you, that's on you bestie. 😭

The maximum length this function will encode is ASN1_MAX_LENGTH_SIZE. That's the ceiling, the limit, the final boss. πŸ‘‘

And here's the little trick iykyk: if you just wanna know the size of the DER encoding before you commit, pass a NULL value for der. It's giving "window shopping before you buy". πŸ›οΈπŸ’–


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. Slay, honestly. 🌈


🌟 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/

okay that's the whole page bestie, go forth and encode those lengths πŸ’…

this was libtasn1 version 4.21.0, page asn1_length_der(3) β€” mwah, bye, love u, stan libtasn1 πŸŽ€πŸ’–πŸ§š

πŸ“¦ where this page comes from