A2D_ASN1_OBJECT(3)
π NAME π
a2d_ASN1_OBJECT β DER content octets of an ASN.1 object identifier. Yup bestie, youβre reading the manual page for A2D_ASN1_OBJECT(3).
β¨ SYNOPSIS β¨
This one comes from the libcrypto library, and the synopsis is literally:
library βlibcryptoβ #include <openssl/asn1.h>
int
a2d_ASN1_OBJECT(unsigned char *der_out, int olen, const char *val_in,
int ilen);
πΈ DESCRIPTION πΈ
okay so a2d_ASN1_OBJECT() is the little encoder bestie. It accepts an ASCII string val_in of ilen bytes and interprets it as the numerical form of an ASN.1 object identifier. Slay.
Then it writes the content octets of the DER encoding of the object identifier to the buffer der_out, which is olen bytes long. π
π¨ Important: the identifier and length octets of the DER encoding are not written. Just the content octets, iykyk.
If ilen is -1, the strlen(3) of val_in is used instead. Lowkey handy.
If der_out is a NULL pointer, writing the content octets is skipped and only the return value is calculated. No actual writing, just return-value vibes.
π RETURN VALUES π
a2d_ASN1_OBJECT() returns the number of content octets that were or would be written, or 0 if any of these happen:
ilenis0val_inis not a valid representation of an object identifier- memory allocation fails
- the number of content octets would be larger than
olen
That 0 is giving βnope, not todayβ energy π β check all the conditions, bestie.
π¦ SEE ALSO π¦
Go peek at:
π STANDARDS π
This page points at ITU-T Recommendation X.690, also known as ISO/IEC 8825-1: Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER), section 8.19: Encoding of an object identifier value. Iconic standards behavior, no cap. β¨
π HISTORY π
a2d_ASN1_OBJECT() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4. Thatβs a long glow-up, fr fr. π
mwah π β footer vibes: Debian, June 8, 2025, A2D_ASN1_OBJECT(3). Bye bestie, go encode something cute π«Ά
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms