mbedtls_pem_write_buffer() function
Write a buffer of PEM information from a DER encoded buffer.
Arguments
The header string to write.
The footer string to write.
der_data
The DER data to encode.
der_len
The length of the DER data \p der_data in Bytes.
buf
The buffer to write to.
buf_len
The length of the output buffer \p buf in Bytes.
olen
The address at which to store the total length written or required (if \p buf_len is not enough).
Return value
\c 0 on success. #MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL if \p buf isn't large enough to hold the PEM buffer. In this case, `*olen` holds the required minimum size of \p buf. Another PEM or BASE64 error code on other kinds of failure.
Notes
You may pass \c NULL for \p buf and \c 0 for \p buf_len to request the length of the resulting PEM buffer in `*olen`. This function may be called with overlapping \p der_data and \p buf buffers.
mbedtls_pem_write_buffer() is called by 4 functions and calls 3 functions:
![]()
mbedtls_pem_write_buffer()
mbedtls_pem_write_buffer():
![]()
mbedtls_pem_write_buffer()