1KCAPI_AKCIPHER_SETKE(3)      Programming Interface     KCAPI_AKCIPHER_SETKE(3)
2
3
4

NAME

6       kcapi_akcipher_setkey - set the private key for the cipher handle
7

SYNOPSIS

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

ARGUMENTS

13       handle
14           [in] cipher handle
15
16       key
17           [in] key buffer in DER format
18
19       keylen
20           [in] length of key buffer
21

DESCRIPTION

23       With this function, the caller sets the key for subsequent cipher
24       operations.
25
26       The key must be in DER format as follows
27
28       SEQUENCE { version INTEGER, n INTEGER ({ rsa_get_n }), e INTEGER ({
29       rsa_get_e }), d INTEGER ({ rsa_get_d }), prime1 INTEGER, prime2
30       INTEGER, exponent1 INTEGER, exponent2 INTEGER, coefficient INTEGER }
31
32       After the caller provided the key, the caller may securely destroy the
33       key as it is now maintained by the kernel.
34
35       return upon success the value of the maximum size for the asymmetric
36       operation is returned (e.g. the modulus size); a negative errno-style
37       error code if an error occurred
38

AUTHOR

40       Stephan Mueller <smueller@chronox.de>
41           Author.
42
44libkcapi Manual 1.2.1             March 2021           KCAPI_AKCIPHER_SETKE(3)
Impressum