base64.h
mbedtls/build_info.h
stddef.h
base64.h
mbedtls/build_info.h
mbedtls/check_config.h
mbedtls/config_adjust_legacy_crypto.h
mbedtls/config_adjust_psa_from_legacy.h
mbedtls/config_adjust_psa_superset_legacy.h
mbedtls/config_adjust_ssl.h
mbedtls/config_adjust_x509.h
mbedtls/config_psa.h
mbedtls/mbedtls_config.h
psa/crypto_adjust_auto_enabled.h
psa/crypto_adjust_config_dependencies.h
psa/crypto_adjust_config_key_pair_types.h
psa/crypto_adjust_config_synonyms.h
psa/crypto_legacy.h
limits.h
stddef.h
stdint.h
MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL
-0x002A

Output buffer too small.

MBEDTLS_ERR_BASE64_INVALID_CHARACTER
-0x002C

Invalid character in input.

int int mbedtls_base64_encode (unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen) mbedtls_base64_encode unsigned char * dst size_t dlen size_t * olen const unsigned char * src size_t slen

Encode a buffer into base64 format.

dst

destination buffer

dlen

size of the destination buffer

olen

number of bytes written

src

source buffer

slen

amount of data to be encoded

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.

Call this function with dlen = 0 to obtain the required buffer size in *olen

int int mbedtls_base64_decode (unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen) mbedtls_base64_decode unsigned char * dst size_t dlen size_t * olen const unsigned char * src size_t slen

Decode a base64-formatted buffer.

dst

destination buffer (can be NULL for checking size)

dlen

size of the destination buffer

olen

number of bytes written

src

source buffer

slen

amount of data to be decoded

0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is not correct. *olen is always updated to reflect the amount of data that has (or would have) been written.

Call this function with *dst = NULL or dlen = 0 to obtain the required buffer size in *olen

int int mbedtls_base64_self_test (int verbose) mbedtls_base64_self_test int verbose

Checkup routine.

0 if successful, or 1 if the test failed

RFC 1521 base64 encoding/decoding.

    /*
    *CopyrightTheMbedTLSContributors
    *SPDX-License-Identifier:Apache-2.0ORGPL-2.0-or-later
    */
    #ifndefMBEDTLS_BASE64_H
    #defineMBEDTLS_BASE64_H

    #include"mbedtls/build_info.h"

    #include<stddef.h>

    #defineMBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL-0x002A
    #defineMBEDTLS_ERR_BASE64_INVALID_CHARACTER-0x002C

    #ifdef__cplusplus
    extern"C"{
    #endif

    intmbedtls_base64_encode(unsignedchar*dst,size_tdlen,size_t*olen,
    constunsignedchar*src,size_tslen);

    intmbedtls_base64_decode(unsignedchar*dst,size_tdlen,size_t*olen,
    constunsignedchar*src,size_tslen);

    #ifdefined(MBEDTLS_SELF_TEST)
    intmbedtls_base64_self_test(intverbose);

    #endif/*MBEDTLS_SELF_TEST*/

    #ifdef__cplusplus
    }
    #endif

    #endif/*base64.h*/