asn1_octet_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_octet_der β€” the libtasn1 glow-up page πŸ’–

okay so bestie, welcome to asn1_octet_der(3), a certified libtasn1 banger. this is the page for the lil API function that turns your raw bytes into a length-value DER moment. sit down, hydrate, let's go ✨


✨ NAME ✨

asn1_octet_der β€” it's an API function, babe. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

#include <libtasn1.h>

void asn1_octet_der(const unsigned char * str, int str_len, unsigned
char * der, int * der_len);

like, look at her. four arguments, zero return value, all main character energy πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const unsigned char * str β€” the input data, bestie. the raw material. the before pic. πŸ’œ
  • int str_len β€” STR length, and to be so for real, that means str[0]..str[*str_len-1]. yes she literally wrote *str_len in the range notation, that's just how it is, don't come for her πŸ™ˆ
  • unsigned char * der β€” the encoded string that gets returned. this is where the magic lands, no cap. ✨
  • int * der_len β€” number of meaningful bytes of DER, i.e. der[0]..der[der_len-1]. she's the one holding the receipts on how much of der actually matters. πŸ’…

πŸ’€ DESCRIPTION πŸ’€

so what does she DO? she creates a length-value DER encoding for the input data, and the DER encoding of the input data will be placed in the der variable. periodt. πŸ”₯

⚠️ heads up bestie: the OCTET STRING tag is NOT included in the output. the tag? not invited. she said this party is length-value only. 😭

and the reason there's no return value at all (not even a lil int, not even a vibe check) is that it's expected that der_len will contain enough bytes to store the string plus the DER encoding. if you need to know how big that DER encoding is gonna be, go get it with asn1_length_der(). that's your girl for sizing. 🫢


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, the double period after Inc. is canon. i don't make the rules, i just respect the source material. πŸŽ€)


🌈 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. slay. πŸ“–βœ¨

as an alternative you may obtain the manual from:

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

go read it, iykyk. πŸ¦‹


and that's the whole page, bestie!! πŸ’– this was asn1_octet_der(3) from libtasn1 version 4.21.0, and it ate, fr fr. now go encode something and be iconic. πŸŽ€πŸ’…πŸŒŸ

πŸ“¦ where this page comes from