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

# libressl-d2i\_GENERAL\_NAME(3)

decode and encode names for use in X.509 extensions

## NAME

**d2i\_GENERAL\_NAME**, **i2d\_GENERAL\_NAME**, **d2i\_GENERAL\_NAMES**, **i2d\_GENERAL\_NAMES**, **d2i\_EDIPARTYNAME**, **i2d\_EDIPARTYNAME**, **d2i\_OTHERNAME**, **i2d\_OTHERNAME** – decode and encode names for use in X.509 extensions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*GENERAL\_NAME* *\**\

**d2i\_GENERAL\_NAME**(*GENERAL\_NAME \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_GENERAL\_NAME**(*GENERAL\_NAME \*val\_in*, *unsigned char \*\*der\_out*);

*GENERAL\_NAMES* *\**\

**d2i\_GENERAL\_NAMES**(*GENERAL\_NAMES \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_GENERAL\_NAMES**(*GENERAL\_NAMES \*val\_in*, *unsigned char \*\*der\_out*);

*EDIPARTYNAME* *\**\

**d2i\_EDIPARTYNAME**(*EDIPARTYNAME \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_EDIPARTYNAME**(*EDIPARTYNAME \*val\_in*, *unsigned char \*\*der\_out*);

*OTHERNAME* *\**\

**d2i\_OTHERNAME**(*OTHERNAME \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_OTHERNAME**(*OTHERNAME \*val\_in*, *unsigned char \*\*der\_out*);

## DESCRIPTION

These functions decode and encode names that can be used in X.509 extensions. For details about the semantics, examples, caveats, and bugs, see ASN1\_item\_d2i(3).

**d2i\_GENERAL\_NAME**() and **i2d\_GENERAL\_NAME**() decode and encode an ASN.1 *GeneralName* structure defined in RFC 5280 section 4.2.1.6.

**d2i\_GENERAL\_NAMES**() and **i2d\_GENERAL\_NAMES**() decode and encode an ASN.1 *GeneralNames* structure defined in RFC 5280 section 4.2.1.6.

**d2i\_EDIPARTYNAME**() and **i2d\_EDIPARTYNAME**() decode and encode an ASN.1 *EDIPartyName* structure defined in RFC 5280 section 4.2.1.6.

**d2i\_OTHERNAME**() and **i2d\_OTHERNAME**() decode and encode an ASN.1 *OtherName* structure defined in RFC 5280 section 4.2.1.6.

## RETURN VALUES

**d2i\_GENERAL\_NAME**(), **d2i\_GENERAL\_NAMES**(), **d2i\_EDIPARTYNAME**(), and **d2i\_OTHERNAME**() return a *GENERAL\_NAME*, *GENERAL\_NAMES*, *EDIPARTYNAME*, or *OTHERNAME* object, respectively, or NULL if an error occurs.

**i2d\_GENERAL\_NAME**(), **i2d\_GENERAL\_NAMES**(), **i2d\_EDIPARTYNAME**(), and **i2d\_OTHERNAME**() return the number of bytes successfully encoded or a negative value if an error occurs.

## SEE ALSO

ASN1\_item\_d2i(3), d2i\_X509\_NAME(3), GENERAL\_NAME\_new(3), X509\_EXTENSION\_new(3)

## STANDARDS

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

## HISTORY

**d2i\_GENERAL\_NAME**(), **i2d\_GENERAL\_NAME**(), **d2i\_GENERAL\_NAMES**(), and **i2d\_GENERAL\_NAMES**() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6.

**d2i\_OTHERNAME**() and **i2d\_OTHERNAME**() first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.

**d2i\_EDIPARTYNAME**() and **i2d\_EDIPARTYNAME**() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.
