Function esp_idf_svc::sys::mbedtls_ecp_write_key_ext
source ยท pub unsafe extern "C" fn mbedtls_ecp_write_key_ext(
key: *const mbedtls_ecp_keypair,
olen: *mut usize,
buf: *mut u8,
buflen: usize,
) -> i32
Expand description
\brief This function exports an elliptic curve private key.
\param key The private key.
\param olen On success, the length of the private key.
This is always (grp->nbits
+ 7) / 8 bytes
where grp->nbits
is the private key size in bits.
\param buf The output buffer for containing the binary representation
of the key.
\param buflen The total length of the buffer in bytes.
#MBEDTLS_ECP_MAX_BYTES is always sufficient.
\return \c 0 on success. \return #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the \p key representation is larger than the available space in \p buf. \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if no private key is set in \p key. \return Another negative error code on different kinds of failure.