yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
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
37date init comment
38----------------------------------------------------------------------
3925-oct-08 abb Begun
40
41*/
42
43
44
45#include "procdefs.h"
46#include "status.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/********************************************************************
53* *
54* F U N C T I O N S *
55* *
56*********************************************************************/
57
58
78extern 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
107extern 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
123extern uint32_t
124 b64_get_decoded_str_len( const uint8_t* inbuff, size_t inputLen );
125
126
134extern uint32_t
135 b64_get_encoded_str_len( uint32_t inbufflen, uint32_t linesize );
136
137
138
160extern 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 */
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:242
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:257
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.
boolean b64_valid_base64(const char *b64str)
Check if a string match base64 encoding or not.
Definition: b64.c:372
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:312
status_t
global error return code
Definition: status_enum.h:210
Global error messages for status code enumerations.