---
name: "libressl-d2i_X509_ALGOR"
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-d2i_X509_ALGOR"
---

# libressl-d2i\_X509\_ALGOR(3)

decode and encode algorithm identifiers

## NAME

**d2i\_X509\_ALGOR**, **i2d\_X509\_ALGOR**, **d2i\_X509\_ALGORS**, **i2d\_X509\_ALGORS** – decode and encode algorithm identifiers

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*X509\_ALGOR* *\**\

**d2i\_X509\_ALGOR**(*X509\_ALGOR \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_X509\_ALGOR**(*X509\_ALGOR \*val\_in*, *unsigned char \*\*der\_out*);

*X509\_ALGORS* *\**\

**d2i\_X509\_ALGORS**(*X509\_ALGORS \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_X509\_ALGORS**(*X509\_ALGORS \*val\_in*, *unsigned char \*\*der\_out*);

## DESCRIPTION

**d2i\_X509\_ALGOR**() and **i2d\_X509\_ALGOR**() decode and encode an ASN.1 *AlgorithmIdentifier* structure defined in RFC 5280 section 4.1.1.2.

**d2i\_X509\_ALGORS**() and **i2d\_X509\_ALGORS**() decode and encode an ASN.1 sequence of *AlgorithmIdentifier* structures. The data type *X509\_ALGORS* is defined as *STACK\_OF(X509\_ALGOR)*.

For details about the semantics, examples, caveats, and bugs, see ASN1\_item\_d2i(3).

## SEE ALSO

ASN1\_item\_d2i(3), STACK\_OF(3), X509\_ALGOR\_new(3)

## STANDARDS

RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile

## HISTORY

**d2i\_X509\_ALGOR**() and **i2d\_X509\_ALGOR**() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.

**d2i\_X509\_ALGORS**() and **i2d\_X509\_ALGORS**() first appeared in OpenSSL 0.9.8h and have been available since OpenBSD 4.5.
