nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ ocrypto_rsa_init_key()

int ocrypto_rsa_init_key ( ocrypto_rsa_key * key,
uint32_t * key_mem,
const uint8_t * n,
size_t n_len,
const uint8_t * d,
size_t d_len )

#include <crypto/nrf_oberon/include/ocrypto_rsa_primitives.h>

RSA secret key setup.

Parameters
[out]keyThe initialized secret key.
[out]key_memKey memory. Length OCRYPTO_RSA_KEY_SIZE(bits). Must have same lifetime as key.
nThe RSA modulus, unsigned big-endian.
n_lenLength of n.
dThe secret exponent, unsigned big-endian.
d_lenLength of d. Must be <= n_len.
Return values
-1If the input length is invalid.
0On success.
Remarks
The n and d values can be read directly from the corresponding value parts of a DER encoded RSAPrivateKey.