A2D_ASN1_OBJECT(3)
π a2d_ASN1_OBJECT(3) π
okay bestie, welcome to A2D_ASN1_OBJECT(3) from the Library Functions Manual. This page is all about grabbing the DER content octets of an ASN.1 object identifier, and honestly? iconic little cryptography business. π¦β¨
πΈ NAME πΈ
a2d_ASN1_OBJECT β DER content octets of an ASN.1 object identifier π
β¨ SYNOPSIS β¨
#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() takes an ASCII string val_in that is ilen bytes long and interprets it as the numerical form of an ASN.1 object identifier. slay. It writes the content octets of the DER encoding of that object identifier to the buffer der_out, which is olen bytes long. π«Ά
Important detail, no cap: the identifier and length octets of the DER encoding are not written. π
If ilen is -1, the strlen(3) of val_in is used instead. lowkey convenient. β¨
If der_out is a NULL pointer, writing the content octets is skipped and only the return value is calculated. vibe check: no writing, just math. π
π RETURN VALUES π
a2d_ASN1_OBJECT() returns the number of content octets that were or would be written. π
It returns 0 if:
ilenis0val_inis not a valid representation of an object identifier- memory allocation fails
- the number of content octets would be larger than
olen
π that is the whole return-value situation, bestie. periodt.
π¦ SEE ALSO π¦
π STANDARDS π
the standards girlies said:
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
π HISTORY π
a2d_ASN1_OBJECT() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4. history icon behavior. β
mwah π sign-off: this page says source Debian, dated August 9, 2023, and it is serving A2D_ASN1_OBJECT(3) realness. π«Άπ no notes.
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· 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