'\" t .\" Title: kcapi_akcipher_setpubkey .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: April 2024 .\" Manual: Programming Interface .\" Source: libkcapi Manual 1.4.0 .\" Language: English .\" .TH "KCAPI_AKCIPHER_SETPU" "3" "April 2024" "libkcapi Manual 1\&.4\&.0" "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_akcipher_setpubkey \- set the public key for the cipher handle .SH "SYNOPSIS" .HP \w'int\ kcapi_akcipher_setpubkey('u .BI "int kcapi_akcipher_setpubkey(struct\ kcapi_handle\ *\ " "handle" ", const\ uint8_t\ *\ " "key" ", uint32_t\ " "keylen" ");" .SH "ARGUMENTS" .PP \fIhandle\fR .RS 4 [in] cipher handle .RE .PP \fIkey\fR .RS 4 [in] key buffer in DER format .RE .PP \fIkeylen\fR .RS 4 [in] length of key buffer .RE .SH "DESCRIPTION" .PP With this function, the caller sets the key for subsequent cipher operations\&. .PP The key must be in DER format as follows .PP SEQUENCE { n INTEGER ({ rsa_get_n }), e INTEGER ({ rsa_get_e }) } .PP After the caller provided the key, the caller may securely destroy the key as it is now maintained by the kernel\&. .PP \fIreturn\fR upon success the value of the maximum size for the asymmetric operation is returned (e\&.g\&. the modulus 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