base64.h File Reference

Go to the source code of this file.

Functions

int decode_base64 (unsigned char *dest, const char *src)
 Decode the base64 encoded string 'src' into the memory pointed to by 'dest'.

int encode_base64 (char **dest, int size, unsigned char *src)
 Base64 encode size data in 'src', into the allocated string pointed to by 'dest'.


Function Documentation

int decode_base64 unsigned char *    dest,
const char *    src
 

Decode the base64 encoded string 'src' into the memory pointed to by 'dest'.

The dest buffer is not NUL terminated.

Parameters:
dest  Pointer to memory for holding the decoded string. Must be large enough to recieve the decoded string.
src  A base64 encoded string.
Returns:
TRUE (the length of the decoded string) if decode succeeded otherwise FALSE.

Definition at line 153 of file base64.c.

References xmalloc().

int encode_base64 char **    dest,
int    size,
unsigned char *    src
 

Base64 encode size data in 'src', into the allocated string pointed to by 'dest'.

The caller must free the dest string.

Parameters:
dest  a pointer to an allocated area with the base64 encode data
size  The size of the data in src
src  The data to be base64 encode
Returns:
TRUE (the length of the encoded string) if encode succeeded otherwise FALSE.

Definition at line 65 of file base64.c.

References xmalloc().

Referenced by get_basic_authentication_header().