x509_b64.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 int MHD__gnutls_fbase64_encode (const char *msg, const uint8_t * data,
00026 int data_size, uint8_t ** result);
00027 int MHD__gnutls_base64_decode (const uint8_t * data, size_t data_size,
00028 uint8_t ** result);
00029 int MHD__gnutls_fbase64_decode (const char *header, const uint8_t * data,
00030 size_t data_size, uint8_t ** result);
00031
00032 #define B64SIZE( data_size) ((data_size%3==0)?((data_size*4)/3):(4+((data_size/3)*4)))
00033
00034
00035
00036
00037 #define HEADSIZE( hsize) \
00038 sizeof("-----BEGIN ")-1+sizeof("-----")-1+ \
00039 sizeof("\n-----END ")-1+sizeof("-----\n")-1+hsize+hsize
00040
00041 #define B64FSIZE( hsize, dsize) \
00042 (B64SIZE(dsize) + HEADSIZE(hsize) + \
00043 B64SIZE(dsize)/64 + (((B64SIZE(dsize) % 64) > 0) ? 1 : 0))