Function esp_idf_svc::sys::mbedtls_rsa_export
source ยท pub unsafe extern "C" fn mbedtls_rsa_export(
ctx: *const mbedtls_rsa_context,
N: *mut mbedtls_mpi,
P: *mut mbedtls_mpi,
Q: *mut mbedtls_mpi,
D: *mut mbedtls_mpi,
E: *mut mbedtls_mpi,
) -> i32
Expand description
\brief This function exports the core parameters of an RSA key.
If this function runs successfully, the non-NULL buffers
pointed to by \p N, \p P, \p Q, \p D, and \p E are fully
written, with additional unused space filled leading by
zero Bytes.
Possible reasons for returning
#MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:<ul>
<li>An alternative RSA implementation is in use, which
stores the key externally, and either cannot or should
not export it into RAM.</li>
<li>A SW or HW implementation might not support a certain
deduction. For example, \p P, \p Q from \p N, \p D,
and \p E if the former are not part of the
implementation.</li></ul>
If the function fails due to an unsupported operation,
the RSA context stays intact and remains usable.
\param ctx The initialized RSA context. \param N The MPI to hold the RSA modulus. This may be \c NULL if this field need not be exported. \param P The MPI to hold the first prime factor of \p N. This may be \c NULL if this field need not be exported. \param Q The MPI to hold the second prime factor of \p N. This may be \c NULL if this field need not be exported. \param D The MPI to hold the private exponent. This may be \c NULL if this field need not be exported. \param E The MPI to hold the public exponent. This may be \c NULL if this field need not be exported.
\return \c 0 on success. \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the requested parameters cannot be done due to missing functionality or because of security policies. \return A non-zero return code on any other failure.