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

# libressl-d2i\_PKEY\_USAGE\_PERIOD(3)

decode and encode X.509 key usage period extensions

## NAME

**d2i\_PKEY\_USAGE\_PERIOD**, **i2d\_PKEY\_USAGE\_PERIOD** – decode and encode X.509 key usage period extensions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*PKEY\_USAGE\_PERIOD* *\**\

**d2i\_PKEY\_USAGE\_PERIOD**(*PKEY\_USAGE\_PERIOD \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_PKEY\_USAGE\_PERIOD**(*PKEY\_USAGE\_PERIOD \*val\_in*, *unsigned char \*\*der\_out*);

## DESCRIPTION

**d2i\_PKEY\_USAGE\_PERIOD**() and **i2d\_PKEY\_USAGE\_PERIOD**() decode and encode an ASN.1 *PrivateKeyUsagePeriod* structure defined in RFC 3280 section 4.2.1.4. For details about the semantics, examples, caveats, and bugs, see ASN1\_item\_d2i(3).

## RETURN VALUES

**d2i\_PKEY\_USAGE\_PERIOD**() returns a *PKEY\_USAGE\_PERIOD* object or NULL if an error occurs.

**i2d\_PKEY\_USAGE\_PERIOD**() returns the number of bytes successfully encoded or a negative value if an error occurs.

## SEE ALSO

ASN1\_item\_d2i(3), PKEY\_USAGE\_PERIOD\_new(3), X509\_EXTENSION\_new(3)

## STANDARDS

RFC 3280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2.1.4: Private Key Usage Period

RFC 3280 was obsoleted by RFC 5280; see PKEY\_USAGE\_PERIOD\_new(3) for details.

## HISTORY

**d2i\_PKEY\_USAGE\_PERIOD**() and **i2d\_PKEY\_USAGE\_PERIOD**() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6.
