base64.h

Name

base64.h -- The BASE64 encode/decode functions.

Synopsis



xmlSecBase64CtxPtr xmlSecBase64CtxCreate    (int encode,
                                             int columns);
void        xmlSecBase64CtxDestroy          (xmlSecBase64CtxPtr ctx);
int         xmlSecBase64CtxUpdate           (xmlSecBase64CtxPtr ctx,
                                             unsigned char *in,
                                             size_t inLen,
                                             unsigned char *out,
                                             size_t outLen);
int         xmlSecBase64CtxFinal            (xmlSecBase64CtxPtr ctx,
                                             unsigned char *out,
                                             size_t outLen);
xmlChar*    xmlSecBase64Encode              (unsigned char *buf,
                                             size_t len,
                                             int columns);
int         xmlSecBase64Decode              (const xmlChar *str,
                                             unsigned char *buf,
                                             size_t len);

Description

Details

xmlSecBase64CtxCreate ()

xmlSecBase64CtxPtr xmlSecBase64CtxCreate    (int encode,
                                             int columns);

Creates new base64 context.


xmlSecBase64CtxDestroy ()

void        xmlSecBase64CtxDestroy          (xmlSecBase64CtxPtr ctx);

Destroys base64 context.


xmlSecBase64CtxUpdate ()

int         xmlSecBase64CtxUpdate           (xmlSecBase64CtxPtr ctx,
                                             unsigned char *in,
                                             size_t inLen,
                                             unsigned char *out,
                                             size_t outLen);

Encodes/decodes the next piece of data from input buffer.


xmlSecBase64CtxFinal ()

int         xmlSecBase64CtxFinal            (xmlSecBase64CtxPtr ctx,
                                             unsigned char *out,
                                             size_t outLen);

Encodes/decodes the last piece of data stored in the context and finalizes the result.


xmlSecBase64Encode ()

xmlChar*    xmlSecBase64Encode              (unsigned char *buf,
                                             size_t len,
                                             int columns);

Encodes the data from input buffer and allocates the string for the result. The caller is responsible for freeing returned buffer using xmlFree() function.


xmlSecBase64Decode ()

int         xmlSecBase64Decode              (const xmlChar *str,
                                             unsigned char *buf,
                                             size_t len);

Decodes input base64 encoded string and puts result into the output buffer.