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

# libressl-X509\_REVOKED\_new(3)

create, change, and inspect an X.509 CRL revoked entry

## NAME

**X509\_REVOKED\_new**, **X509\_REVOKED\_dup**, **X509\_REVOKED\_free**, **X509\_REVOKED\_get0\_serialNumber**, **X509\_REVOKED\_get0\_revocationDate**, **X509\_REVOKED\_set\_serialNumber**, **X509\_REVOKED\_set\_revocationDate** – create, change, and inspect an X.509 CRL revoked entry

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*X509\_REVOKED* *\**\

**X509\_REVOKED\_new**(*void*);

*X509\_REVOKED* *\**\

**X509\_REVOKED\_dup**(*X509\_REVOKED \*r*);

*void*\

**X509\_REVOKED\_free**(*X509\_REVOKED \*r*);

*const* *ASN1\_INTEGER* *\**\

**X509\_REVOKED\_get0\_serialNumber**(*const X509\_REVOKED \*r*);

*const* *ASN1\_TIME* *\**\

**X509\_REVOKED\_get0\_revocationDate**(*const X509\_REVOKED \*r*);

*int*\

**X509\_REVOKED\_set\_serialNumber**(*X509\_REVOKED \*r*, *ASN1\_INTEGER \*serial*);

*int*\

**X509\_REVOKED\_set\_revocationDate**(*X509\_REVOKED \*r*, *ASN1\_TIME \*tm*);

## DESCRIPTION

**X509\_REVOKED\_new**() allocates and initializes an empty *X509\_REVOKED* object, representing one of the elements of the revokedCertificates field of the ASN.1 *TBSCertList* structure defined in RFC 5280 section 5.1. It is used by *X509\_CRL* objects and can hold information about one revoked certificate including issuer names, serial number, revocation date, and revocation reason.

**X509\_REVOKED\_dup**() creates a deep copy of *r*.

**X509\_REVOKED\_free**() frees *r*.

**X509\_REVOKED\_set\_serialNumber**() sets the serial number of *r* to *serial*. The supplied *serial* pointer is not used internally so it should be freed up after use.

**X509\_REVOKED\_set\_revocationDate**() sets the revocation date of *r* to *tm*. The supplied *tm* pointer is not used internally so it should be freed up after use.

## RETURN VALUES

The **X509\_REVOKED\_new**() function returns the new *X509\_REVOKED* object if successful; otherwise NULL is returned and an error code can be retrieved with ERR\_get\_error(3).

**X509\_REVOKED\_dup**() return the new *X509\_REVOKED* object or NULL if an error occurs. In some cases of failure, the reason can be determined with ERR\_get\_error(3).

**X509\_REVOKED\_get0\_serialNumber**() returns an internal pointer to the serial number of *r*.

**X509\_REVOKED\_get0\_revocationDate**() returns an internal pointer to the revocation date of *r*.

**X509\_REVOKED\_set\_serialNumber**() and **X509\_REVOKED\_set\_revocationDate**() return 1 for success or 0 for failure. In some cases of failure, the reason can be determined with ERR\_get\_error(3).

## SEE ALSO

d2i\_X509\_CRL(3), PEM\_read\_X509\_CRL(3), X509\_CRL\_get0\_by\_serial(3), X509\_CRL\_new(3), X509\_CRL\_print(3), X509\_EXTENSION\_new(3), X509\_REVOKED\_get\_ext(3), X509\_REVOKED\_get\_ext\_d2i(3)

## STANDARDS

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

## HISTORY

**X509\_REVOKED\_new**() and **X509\_REVOKED\_free**() first appeared in SSLeay 0.4.4 and have been available since OpenBSD 2.4.

**X509\_REVOKED\_set\_serialNumber**() and **X509\_REVOKED\_set\_revocationDate**() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.

**X509\_REVOKED\_dup**() first appeared in OpenSSL 1.0.2. **X509\_REVOKED\_get0\_serialNumber**() and **X509\_REVOKED\_get0\_revocationDate**() first appeared in OpenSSL 1.1.0. These functions have been available since OpenBSD 6.3.
