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

# libressl-X509\_get1\_email(3)

utilities for stacks of strings

## NAME

**X509\_get1\_email**, **X509\_get1\_ocsp**, **X509\_email\_free** – utilities for stacks of strings

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*typedef* *char* *\*OPENSSL\_STRING*;

*STACK\_OF(OPENSSL\_STRING)* *\**\

**X509\_get1\_email**(*X509 \*certificate*);

*STACK\_OF(OPENSSL\_STRING)* *\**\

**X509\_get1\_ocsp**(*X509 \*certificate*);

*void*\

**X509\_email\_free**(*STACK\_OF(OPENSSL\_STRING) \*stack*);

## DESCRIPTION

**X509\_get1\_email**() retrieves all email addresses from the *subject* field and from any Subject Alternative Name extension of the *certificate*.

**X509\_get1\_ocsp**() retrieves all uniform resource identifiers from all *AccessDescription* objects having an *accessMethod* of OCSP which are contained in the Authority Information Access extension of the *certificate*.

**X509\_email\_free**() frees all strings stored in the *stack* as well as the stack itself. If *stack* is a NULL pointer, no action occurs.

## RETURN VALUES

**X509\_REQ\_get1\_email**() and **X509\_get1\_ocsp**() return newly allocated stacks of *char* *\** containing copies of the addresses in question, or NULL if there are no addresses or if an error occurs.

## SEE ALSO

OCSP\_sendreq\_new(3), OCSP\_SERVICELOC\_new(3), OPENSSL\_sk\_new(3), STACK\_OF(3), X509\_check\_email(3), X509\_get\_ext\_d2i(3), X509\_get\_subject\_name(3), X509\_new(3), [x509v3.cnf(5)](/x509v3.cnf/5.md)

## STANDARDS

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

- section 4.1: Basic Certificate Fields

- section 4.1.2.6: Subject

- section 4.2.1.6: Subject Alternative Name

- section 4.2.2.1: Authority Information Access

RFC 2985: PKCS #9: Selected Object Classes and Attribute Types

- section 5.2.1: Electronic-mail address

- appendix B.3.5: emailAddress

## HISTORY

**X509\_get1\_email**() and **X509\_email\_free**() first appeared in OpenSSL 0.9.6 and have been available since OpenBSD 2.9.

**X509\_get1\_ocsp**() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 4.5.

## BUGS

**X509\_email\_free**() is utterly misnamed. It does not operate on any *X509* object, nor is it in any way restricted to email addresses; instead, it simply frees a stack of strings.
