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

# libressl-GENERAL\_NAME\_new(3)

names for use in X.509 extensions

## NAME

**GENERAL\_NAME\_new**, **GENERAL\_NAME\_free**, **GENERAL\_NAMES\_new**, **GENERAL\_NAMES\_free**, **EDIPARTYNAME\_new**, **EDIPARTYNAME\_free**, **OTHERNAME\_new**, **OTHERNAME\_free** – names for use in X.509 extensions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*GENERAL\_NAME* *\**\

**GENERAL\_NAME\_new**(*void*);

*void*\

**GENERAL\_NAME\_free**(*GENERAL\_NAME \*name*);

*GENERAL\_NAMES* *\**\

**GENERAL\_NAMES\_new**(*void*);

*void*\

**GENERAL\_NAMES\_free**(*GENERAL\_NAMES \*names*);

*EDIPARTYNAME* *\**\

**EDIPARTYNAME\_new**(*void*);

*void*\

**EDIPARTYNAME\_free**(*EDIPARTYNAME \*name*);

*OTHERNAME* *\**\

**OTHERNAME\_new**(*void*);

*void*\

**OTHERNAME\_free**(*OTHERNAME \*name*);

## DESCRIPTION

Even though the X.501 *Name* documented in X509\_NAME\_new(3) is a complicated multi-layered structure, it is very rigid and not flexible enough to represent various entities that many people want to use as names in certificates. For that reason, X.509 extensions use the X.509 *GeneralName* wrapper structure rather than using the X.501 *Name* structure directly, at the expense of adding one or two additional layers of indirection.

**GENERAL\_NAME\_new**() allocates and initializes an empty *GENERAL\_NAME* object, representing the ASN.1 *GeneralName* structure defined in RFC 5280 section 4.2.1.6. It can for example hold an *X509\_name* object, an IP address, a DNS host name, a uniform resource identifier, an email address, or an *EDIPARTYNAME* or *OTHERNAME* object described below. **GENERAL\_NAME\_free**() frees *name*.

**GENERAL\_NAMES\_new**() allocates and initializes an empty *GENERAL\_NAMES* object, which is a *STACK\_OF(GENERAL\_NAME)* and represents the ASN.1 *GeneralNames* structure defined in RFC 5280 section 4.2.1.6. It is used by extension structures that can contain multiple names, for example key identifier, alternative name, and distribution point extensions. **GENERAL\_NAMES\_free**() frees *names*.

**EDIPARTYNAME\_new**() allocates and initializes an empty *EDIPARTYNAME* object, representing the ASN.1 *EDIPartyName* structure defined in RFC 5280 section 4.2.1.6, where “EDI” stands for “electronic data identifier”. It can hold two strings, the name itself and the name of the authority that assigned that name. **EDIPARTYNAME\_free**() frees *name*.

**OTHERNAME\_new**() allocates and initializes an empty *OTHERNAME* object, representing the ASN.1 *OtherName* structure defined in RFC 5280 section 4.2.1.6. It can hold data of any *ASN1\_TYPE* together with a type identifier. **OTHERNAME\_free**() frees *name*.

## RETURN VALUES

**GENERAL\_NAME\_new**(), **GENERAL\_NAMES\_new**(), **EDIPARTYNAME\_new**(), and **OTHERNAME\_new**() return a new *GENERAL\_NAME*, *GENERAL\_NAMES*, *EDIPARTYNAME*, or *OTHERNAME* object or NULL if an error occurs.

## SEE ALSO

d2i\_GENERAL\_NAME(3), X509\_EXTENSION\_new(3), X509\_NAME\_new(3)

## STANDARDS

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

## HISTORY

**GENERAL\_NAME\_new**(), **GENERAL\_NAME\_free**(), **GENERAL\_NAMES\_new**(), and **GENERAL\_NAMES\_free**() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6.

**OTHERNAME\_new**() and **OTHERNAME\_free**() first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.

**EDIPARTYNAME\_new**() and **EDIPARTYNAME\_free**() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.
