A2D_ASN1_OBJECT(3)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

πŸ’– 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:

  • ilen is 0
  • val_in is 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