---
name: "kcapi_kpp_dh_setparam_pkcs3"
section: "3"
platform: "linux"
package: "libkcapi-dev"
version: "1.4.0-1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/kcapi_kpp_dh_setparam_pkcs3"
---

# kcapi\_kpp\_dh\_setparam\_pkcs3(3)

set the PG parameters using PKCS3 format

## NAME

kcapi\_kpp\_dh\_setparam\_pkcs3 - set the PG parameters using PKCS3 format

## SYNOPSIS

**int kcapi\_kpp\_dh\_setparam\_pkcs3(struct kcapi\_handle \*** *handle***, const uint8\_t \*** *pkcs3***, uint32\_t** *pkcs3len***);**

## ARGUMENTS

*handle*

\[in\] cipher handle

*pkcs3*

\[in\] parameter buffer in DER format

*pkcs3len*

\[in\] length of key buffer

## DESCRIPTION

With this function, the caller sets the PG parameters for subsequent cipher operations.

The parameter set must be in DER format as follows

SEQUENCE { prime INTEGER ({ dh\_get\_p }), base INTEGER ({ dh\_get\_g }) }

The following command generates such parameter set where the output

## FILE CONTENT IS HAS THE CORRECT DER STRUCTURE

openssl dhparam -outform DER -out dhparam.der 2048

Note, this function defines that the subsequent key generation and shared secret operation performs an FFC Diffie-Hellman operation.

After the caller provided the key, the caller may destroy the parameter as it is now maintained by the kernel.

*return* upon success the value of the maximum size for the KPP operation is returned (e.g. the prime size); a negative errno-style error code if an error occurred

## AUTHOR

**Stephan Mueller** \<smueller@chronox.de\>

Author.

## COPYRIGHT
