/home/dko/projects/mobilec/trunk/src/security/xyssl-0.9/include/xyssl/base64.h File Reference
Go to the source code of this file.
Defines
Functions
Encode a buffer into base64 format.
Decode a base64-formatted buffer.
Checkup routine.
Detailed Description
Definition in file base64.h.
Define Documentation
#define XYSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x0010
#define XYSSL_ERR_BASE64_INVALID_CHARACTER -0x0012
Function Documentation
int base64_decode
(
unsigned char *
dst,
unsigned char *
src,
)
Decode a base64-formatted buffer.
- Parameters:
-
dst destination buffer
dlen size of the buffer
src source buffer
slen amount of data to be decoded
- Returns:
- 0 if successful, XYSSL_ERR_BASE64_BUFFER_TOO_SMALL, or XYSSL_ERR_BASE64_INVALID_DATA if the input data is not correct. *dlen is always updated to reflect the amount of data that has (or would have) been written.
- Note:
- Call this function with *dlen = 0 to obtain the required buffer size in *dlen
int base64_encode
(
unsigned char *
dst,
unsigned char *
src,
)
Encode a buffer into base64 format.
- Parameters:
-
dst destination buffer
dlen size of the buffer
src source buffer
slen amount of data to be encoded
- Returns:
- 0 if successful, or XYSSL_ERR_BASE64_BUFFER_TOO_SMALL. *dlen is always updated to reflect the amount of data that has (or would have) been written.
- Note:
- Call this function with *dlen = 0 to obtain the required buffer size in *dlen
int base64_self_test
(
int
verbose
)
Checkup routine.
- Returns:
- 0 if successful, or 1 if the test failed
Referenced by main().