kcapi_akcipher_setkey(3)

kcapi_akcipher_setkey3

Set the private key for the cipher handle

Usage

int kcapi_akcipher_setkey(struct kcapi_handle * handle, const uint8_t * key, uint32_t keylen);

Arguments

handle

[in] cipher handle

key

[in] key buffer in DER format

keylen

[in] length of key buffer

Overview

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

The key must be in DER format as follows

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 }

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

return 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

Releases

3 releases since Debian 11 (Bullseye); the text changed 2 times.

  1. 11
  2. 12
  3. 13

Author

Stephan Mueller <[email protected]>

Author.

From libkcapi-dev 1.4.0-1+b2 in Debian 13 (Trixie). Parsed by carta from the page's man source.