'\" t .\" Title: kcapi_kpp_dh_setparam_pkcs3 .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: November 2020 .\" Manual: Programming Interface .\" Source: libkcapi Manual 1.2.1 .\" Language: English .\" .TH "KCAPI_KPP_DH_SETPARA" "3" "November 2020" "libkcapi Manual 1\&.2\&.1" "Programming Interface" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kcapi_kpp_dh_setparam_pkcs3 \- set the PG parameters using PKCS3 format .SH "SYNOPSIS" .HP \w'int\ kcapi_kpp_dh_setparam_pkcs3('u .BI "int kcapi_kpp_dh_setparam_pkcs3(struct\ kcapi_handle\ *\ " "handle" ", const\ uint8_t\ *\ " "pkcs3" ", uint32_t\ " "pkcs3len" ");" .SH "ARGUMENTS" .PP \fIhandle\fR .RS 4 [in] cipher handle .RE .PP \fIpkcs3\fR .RS 4 [in] parameter buffer in DER format .RE .PP \fIpkcs3len\fR .RS 4 [in] length of key buffer .RE .SH "DESCRIPTION" .PP With this function, the caller sets the PG parameters for subsequent cipher operations\&. .PP The parameter set must be in DER format as follows .PP SEQUENCE { prime INTEGER ({ dh_get_p }), base INTEGER ({ dh_get_g }) } .PP The following command generates such parameter set where the output .SH "FILE CONTENT IS HAS THE CORRECT DER STRUCTURE" .PP .PP openssl dhparam \-outform DER \-out dhparam\&.der 2048 .PP Note, this function defines that the subsequent key generation and shared secret operation performs an FFC Diffie\-Hellman operation\&. .PP After the caller provided the key, the caller may destroy the parameter as it is now maintained by the kernel\&. .PP \fIreturn\fR 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 .SH "AUTHOR" .PP \fBStephan Mueller\fR <\&smueller@chronox.de\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br