yumapro  20.10-12
YumaPro SDK
b64.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_b64
13 #define _H_b64
14 
15 /* FILE: b64.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*
29  RFC 4648 base64 support, from b64.c
30 
31 *********************************************************************
32 * *
33 * C H A N G E H I S T O R Y *
34 * *
35 *********************************************************************
36 
37 date init comment
38 ----------------------------------------------------------------------
39 25-oct-08 abb Begun
40 
41 */
42 
43 
44 
45 #include "procdefs.h"
46 #include "status.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /********************************************************************
53 * *
54 * F U N C T I O N S *
55 * *
56 *********************************************************************/
57 
58 
78 extern status_t
79  b64_encode ( const unsigned char *inbuff,
80  unsigned int inbufflen,
81  unsigned char *outbuff,
82  unsigned int outbufflen,
83  unsigned int linesize,
84  unsigned int *retlen );
85 
107 extern status_t
108  b64_decode ( const uint8_t* inbuff,
109  uint32_t inbufflen,
110  uint8_t* outbuff,
111  uint32_t outbufflen,
112  uint32_t* retlen );
113 
114 
123 extern uint32_t
124  b64_get_decoded_str_len( const uint8_t* inbuff, size_t inputLen );
125 
126 
134 extern uint32_t
135  b64_get_encoded_str_len( uint32_t inbufflen, uint32_t linesize );
136 
137 
138 
160 extern boolean b64_valid_base64 (const char *b64str);
161 
162  // END b64util
164 
165 
166 #ifdef __cplusplus
167 } /* end extern 'C' */
168 #endif
169 
170 #endif /* _H_b64 */
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
b64.h
Base64 Utilities.
b64_valid_base64
boolean b64_valid_base64(const char *b64str)
Check if a string match base64 encoding or not.
Definition: b64.c:369
log.h
NCX System Logging Manager.
ERR_BUFF_OVFL
@ ERR_BUFF_OVFL
106
Definition: status_enum.h:218
b64_decode
status_t b64_decode(const uint8_t *inbuff, uint32_t inbufflen, uint8_t *outbuff, uint32_t outbufflen, uint32_t *retlen)
Decode a base64 string.
Definition: b64.c:310
b64_get_encoded_str_len
uint32_t b64_get_encoded_str_len(uint32_t inbufflen, uint32_t linesize)
Get the output buffer size required for encoding the string.
Definition: b64.c:241
b64_get_decoded_str_len
uint32_t b64_get_decoded_str_len(const uint8_t *inbuff, size_t inputlen)
Calculate the length of the buffer required to decode the base64 string.
Definition: b64.c:256
status.h
Global error messages for status code enumerations.
b64_encode
status_t b64_encode(const unsigned char *inbuff, unsigned int inbufflen, unsigned char *outbuff, unsigned int outbufflen, unsigned int linesize, unsigned int *retlen)
base64 encode a stream adding padding and line breaks as per spec.