KCAPI_AKCIPHER_SETKE(3)
π NAME π
kcapi_akcipher_setkey β bestie, this is the one that sets the private key for the cipher handle π
β¨ SYNOPSIS β¨
int kcapi_akcipher_setkey(struct kcapi_handle * handle,
const uint8_t * key, uint32_t keylen);
π ARGUMENTS π
handleβ [in] the cipher handle, aka the little guy you're doing all this for π«Άkeyβ [in] the key buffer, and it's gotta be in DER format or it's not the vibekeylenβ [in] how long that key buffer is, in bytes
πΈ DESCRIPTION πΈ
Okay so basically: you call this and the caller sets the key for all the cipher operations that come next. That's it, that's the whole job. β¨
The key must be in DER format, and it has to look exactly like this:
SEQUENCE { version INTEGER, n INTEGER ({ rsa_get_n }), e INTEGER ({ rsa_get_e }), d INTEGER ({ rsa_get_d }), prime1 INTEGER, prime2 INTEGER, exponent1 INTEGER, exponent2 INTEGER, coefficient INTEGER }
Not me being dramatic but π if it's not in this DER shape it's giving "nope".
Once the caller has handed the key over, the caller may securely destroy the key β because at that point it's being maintained by the kernel, so it's not your problem anymore. Lowkey iconic. π
As for what comes back: upon success, the return value is the maximum size for the asymmetric operation (like, say, the modulus size π). And if something went wrong? You get a negative errno-style error code. No cap. π
π¦ AUTHOR π¦
Stephan Mueller <smueller@chronox.de> β Author. π«Ά
π COPYRIGHT π
libkcapi Manual 1.5.0 July 2025 β that's the version and the date, bestie, and that's the whole page, fr fr πΈπβ¨
π¦ where this page comes from
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms