Function esp_idf_sys::mbedtls_pk_parse_keyfile
source ยท pub unsafe extern "C" fn mbedtls_pk_parse_keyfile(
ctx: *mut mbedtls_pk_context,
path: *const c_char,
password: *const c_char,
f_rng: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut c_uchar, arg3: usize) -> c_int>,
p_rng: *mut c_void,
) -> c_int
Expand description
\ingroup pk_module / /* \brief Load and parse a private key
\note If #MBEDTLS_USE_PSA_CRYPTO is enabled, the PSA crypto subsystem must have been initialized by calling psa_crypto_init() before calling this function.
\param ctx The PK context to fill. It must have been initialized but not set up. \param path filename to read the private key from \param password Optional password to decrypt the file. Pass \c NULL if expecting a non-encrypted key. Pass a null-terminated string if expecting an encrypted key; a non-encrypted key will also be accepted. The empty password is not supported. \param f_rng RNG function, must not be \c NULL. Used for blinding. \param p_rng RNG parameter
\note On entry, ctx must be empty, either freshly initialised with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a specific key type, check the result with mbedtls_pk_can_do().
\note The key is also checked for correctness.
\return 0 if successful, or a specific PK or PEM error code