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

# libressl-d2i\_DHparams(3)

PKCS#3 DH parameter functions

## NAME

**d2i\_DHparams**, **i2d\_DHparams** – PKCS#3 DH parameter functions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*DH* *\**\

**d2i\_DHparams**(*DH \*\*a*, *unsigned char \*\*pp*, *long length*);

*int*\

**i2d\_DHparams**(*DH \*a*, *unsigned char \*\*pp*);

## DESCRIPTION

These functions decode and encode PKCS#3 DH parameters using the DHparameter structure described in PKCS#3. They otherwise behave in a way similar to d2i\_X509(3) and i2d\_X509(3).

## RETURN VALUES

**d2i\_DHparams**() returns a *DH* object or NULL if an error occurs.

**i2d\_DHparams**() returns the number of bytes successfully encoded or a value \<= 0 if an error occurs.

## SEE ALSO

d2i\_X509(3), DH\_new(3)

## HISTORY

**d2i\_DHparams**() and **i2d\_DHparams**() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.
