KCAPI_AKCIPHER_SETKE(3) | Programming Interface | KCAPI_AKCIPHER_SETKE(3) |
NAME¶
kcapi_akcipher_setkey - set 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
key
keylen
DESCRIPTION¶
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 0 upon success; a negative errno-style error code if an error occurred
AUTHOR¶
Stephan Mueller <smueller@chronox.de>
COPYRIGHT¶
July 2017 | libkcapi Manual 0.13.0 |