---
name: "libressl-a2d_ASN1_OBJECT"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-a2d_ASN1_OBJECT"
---

# libressl-a2d\_ASN1\_OBJECT(3)

DER content octets of an ASN.1 object identifier

## NAME

**a2d\_ASN1\_OBJECT** – DER content octets of an ASN.1 object identifier

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/asn1.h\>**

*int*\

**a2d\_ASN1\_OBJECT**(*unsigned char \*der\_out*, *int olen*, *const char \*val\_in*, *int ilen*);

## DESCRIPTION

**a2d\_ASN1\_OBJECT**() accepts an ASCII string *val\_in* of *ilen* bytes and interprets it as the numerical form of an ASN.1 object identifier. It writes the content octets of the DER encoding of the object identifier to the buffer *der\_out* which is *olen* bytes long. The identifier and length octets of the DER encoding are not written.

If *ilen* is -1, the [strlen(3)](/strlen/3.md) of *val\_in* is used instead.

If *der\_out* is a NULL pointer, writing the content octets is skipped and only the return value is calculated.

## RETURN VALUES

**a2d\_ASN1\_OBJECT**() returns the number of content octets that were or would be written or 0 if *ilen* is 0, if *val\_in* is not a valid representation of an object identifier, if memory allocation fails, or if the number of content octets would be larger than *olen*.

## SEE ALSO

ASN1\_OBJECT\_new(3), i2d\_ASN1\_OBJECT(3), OBJ\_create(3)

## STANDARDS

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.
