asn1_decode_simple_ber(3)
β¨ asn1_decode_simple_ber β¨
okay bestie, so this is a page from the libtasn1 manual β like, the whole manual name is literally just libtasn1, no cap β and today's main character is the function asn1_decode_simple_ber. it's an API function. let's get into it π
πΈ SYNOPSIS πΈ
#include <libtasn1.h>
int asn1_decode_simple_ber(unsigned int etype, const unsigned char *
der, unsigned int _der_len, unsigned char ** str, unsigned int *
str_len, unsigned int * ber_len);
there she is. iconic. screenshot it for later πΈ
π ARGUMENTS π
unsigned int etypeβ the type of the string that's getting encoded, and it's one of theASN1_ETYPE_ones, iykykconst unsigned char * derβ the encoded string itself, the actual bytes bestieunsigned int _der_lenβ how many bytes are in that encoded stringunsigned char ** strβ a pointer to the dataunsigned int * str_lenβ the length of the dataunsigned int * ber_lenβ the total length occupied by BER, and lowkey this one may beNULLif you're not about that life
π¦ DESCRIPTION π¦
so what does it do. it decodes a BER encoded type, periodt. the output is an allocated value of the data β yes, allocated, she's yours to free, we don't make the rules π
and here's the important bit, the vibe check: this decodes BER STRINGS only. literally only strings. any other type gets decoded as DER instead. so don't come at her expecting BER for your non-string types, she said no π
β RETURNS β
ASN1_SUCCESSif everything slayed β¨- or an error value, if it did not π
π COPYRIGHT π
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.
(that's the legal tea and we're keeping it exactly as-is, no edits, we respect the paperwork π«Ά)
π SEE ALSO π
the full documentation for libtasn1 lives in a Texinfo manual β yes, the whole thing. so 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 if info isn't your thing, as an alternative you may obtain the manual from:
https://www.gnu.org/software/libtasn1/manual/
and that's the page, bestie!! this was libtasn1 version 4.21.0, manual section asn1_decode_simple_ber(3) β go forth, decode your BER strings, free your allocations, and stay hydrated ππ§π
π¦ where this page comes from
- alpine 3.22: libtasn1-doc 4.21.0-r0 Β· LGPL-2.1-or-later
- alpine 3.23: libtasn1-doc 4.21.0-r0 Β· LGPL-2.1-or-later
- alpine 3.24: libtasn1-doc 4.21.0-r0 Β· LGPL-2.1-or-later
- arch rolling: libtasn1 4.21.0-1 Β· GPL-3.0-or-later AND LGPL-2.1-or-later AND GFDL-1.3-or-later
- fedora 43: libtasn1-devel 4.21.0-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: libtasn1-devel 4.21.0-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: libtasn1-devel 4.21.0-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: libtasn1-devel 4.21.0-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libtasn1-devel 4.21.0-160000.1.1 Β· GFDL-1.3-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libtasn1-devel 4.21.0-160000.1.1 Β· GFDL-1.3-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libtasn1-devel 4.21.0-160000.1.1 Β· GFDL-1.3-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libtasn1-devel 4.21.0-160000.1.1 Β· GFDL-1.3-or-later AND LGPL-2.1-or-later
- ubuntu resolute: libtasn1-6-dev 4.21.0-2
- ubuntu stonking: libtasn1-6-dev 4.21.0-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms