asn1_der_decoding_startEnd(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_startEnd β€” bestie edition

okay so you're here for asn1_der_decoding_startEnd, which is a libtasn1 API function, and honestly? it's giving "where exactly in this DER blob does my thing live". come sit, i got you πŸ’–


✨ NAME ✨

asn1_der_decoding_startEnd β€” it's an API function, that's the whole vibe 🫢


🌸 SYNOPSIS 🌸

#include <libtasn1.h>

int asn1_der_decoding_startEnd(asn1_node element, const void * ider, int
ider_len, const char * name_element, int * start, int * end);

πŸŽ€ ARGUMENTS πŸŽ€

  • asn1_node element β€” pointer to an ASN1 element. literally just a pointer, that's it.
  • const void * ider β€” the vector that contains the DER encoding.
  • int ider_len β€” how many bytes live in *ider: that's ider[0]..ider[len-1], no more no less.
  • const char * name_element β€” an element of the NAME structure.
  • int * start β€” the position of the first byte of NAME_ELEMENT decoding, aka ider[*start].
  • int * end β€” the position of the last byte of NAME_ELEMENT decoding, aka ider[*end].

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole point: find the start and end point of an element inside a DER encoding string. like, imagine you've got a DER encoding and you've already used asn1_der_decoding() to fill up a structure β€” and now you're sitting there like "hmm, i want the actual piece of string that concerns one specific element of that structure". that's the job. that's the assignment. πŸ‘‘

classic example? the sequence "tbsCertificate" inside an X509 certificate. iconic behavior, honestly.

✨ note: since libtasn1 3.7, the ider and ider_len parameters can be omitted if the element is already decoded using asn1_der_decoding(). so you don't have to pass them anymore in that case. slay.

⭐ RETURNS ⭐

  • ASN1_SUCCESS β€” DER encoding OK, we ate, we devoured πŸ“
  • ASN1_ELEMENT_NOT_FOUND β€” ELEMENT is asn1_node EMPTY, or name_element is not a valid element 😭
  • ASN1_TAG_ERROR β€” der encoding doesn't match the structure ELEMENT
  • ASN1_DER_ERROR β€” also when the der encoding doesn't match the structure ELEMENT

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.


🌈 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 bestie that's the whole page, no cap, every single detail intact πŸ’…βœ¨ this was asn1_der_decoding_startEnd(3) from libtasn1, version 4.21.0 β€” and yes she's still that girl. bye, go decode something iconic πŸŽ€πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from