mbedtls_base64_encode() function
Encode a buffer into base64 format
Syntax
int mbedtls_base64_encode(unsigned char *dst,
size_t dlen,
size_t *olen,
const unsigned char *src,
size_t slen);
Arguments
dlen
size of the destination buffer
olen
number of bytes written
slen
amount of data to be encoded
Return value
0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL. *olen is always updated to reflect the amount of data that has (or would have) been written. If that length cannot be represented, then no data is written to the buffer and *olen is set to the maximum length representable as a size_t.
Notes
Call this function with dlen = 0 to obtain the required buffer size in *olen
![]()
int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen,![]()
int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen,![]()
if (mbedtls_base64_encode(buffer, sizeof(buffer), &len, src, 64) != 0 ||![]()
if ((ret = mbedtls_base64_encode(encode_buf, use_len, &use_len, der_data,
mbedtls_base64_encode() is called by 2 functions and calls 1 function:
![]()
mbedtls_base64_encode()
mbedtls_base64_encode():
![]()
mbedtls_base64_encode()