/home/dko/projects/mobilec/trunk/src/security/xyssl-0.7/include/xyssl/base64.h File Reference

Go to the source code of this file.

Defines

#define ERR_BASE64_BUFFER_TOO_SMALL   0x0010
#define ERR_BASE64_INVALID_CHARACTER   0x0012

Functions

int base64_encode (unsigned char *dst, int *dlen, unsigned char *src, int slen)
 Encode a buffer into base64 format.
int base64_decode (unsigned char *dst, int *dlen, unsigned char *src, int slen)
 Decode a base64-formatted buffer.
int base64_self_test (int verbose)
 Checkup routine.


Detailed Description

Definition in file base64.h.


Define Documentation

#define ERR_BASE64_BUFFER_TOO_SMALL   0x0010

Definition at line 11 of file base64.h.

Referenced by base64_decode(), and base64_encode().

#define ERR_BASE64_INVALID_CHARACTER   0x0012

Definition at line 12 of file base64.h.

Referenced by base64_decode(), x509_add_certs(), and x509_parse_key().


Function Documentation

int base64_decode ( unsigned char *  dst,
int dlen,
unsigned char *  src,
int  slen 
)

Decode a base64-formatted buffer.

Parameters:
dst destination buffer
dlen size of the buffer (updated after call)
src source buffer
slen amount of data to be decoded
Returns:
0 if successful, ERR_BASE64_BUFFER_TOO_SMALL, or ERR_BASE64_INVALID_DATA if an invalid char is found. *dlen is always updated to reflect to amount of data that was written (or would have been written)
Note:
Call this function with *dlen = 0 to obtain the required buffer size in *dlen

Definition at line 118 of file base64.c.

References base64_dec_map, ERR_BASE64_BUFFER_TOO_SMALL, and ERR_BASE64_INVALID_CHARACTER.

Referenced by x509_add_certs(), and x509_parse_key().

int base64_encode ( unsigned char *  dst,
int dlen,
unsigned char *  src,
int  slen 
)

Encode a buffer into base64 format.

Parameters:
dst destination buffer
dlen size of the buffer (updated after call)
src source buffer
slen amount of data to be encoded
Returns:
0 if successful, or ERR_BASE64_BUFFER_TOO_SMALL. *dlen is always updated to reflect to amount of data that was written (or would have been written)
Note:
Call this function with *dlen = 0 to obtain the required buffer size in *dlen

Definition at line 58 of file base64.c.

References base64_enc_map, and ERR_BASE64_BUFFER_TOO_SMALL.

int base64_self_test ( int  verbose  ) 

Checkup routine.

Returns:
0 if successful, or 1 if the test failed

Definition at line 245 of file base64.c.

Referenced by main().


Generated on Fri May 16 14:49:56 2008 for Mobile-C by  doxygen 1.5.4