RDK Documentation (Open Sourced RDK Components)
_base64.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #ifndef BASE64_H
21 #define BASE64_H
22 
23 /**
24  * @file _base64.h
25  * @brief base64 source Encoder/Decoder
26  */
27 
28 #include <stddef.h>
29 
30 /**
31  * @fn base64_Encode
32  * @param src pointer to first byte of binary data to be encoded
33  * @param len number of bytes to encode
34  */
35 char *base64_Encode(const unsigned char *src, size_t len);
36 
37 /**
38  * @fn base64_Decode
39  * @param src pointer to cstring containing base64-encoded data
40  * @param len receives byte length of returned pointer, or zero upon failure
41  */
42 unsigned char *base64_Decode(const char *src, size_t *len);
43 
44 /**
45  * @fn base64_Decode
46  * @param src pointer to cstring containing base64-encoded data
47  * @param len receives byte length of returned pointer, or zero upon failure
48  * @param srcLen string length of src
49  */
50 unsigned char *base64_Decode(const char *src, size_t *len, size_t srcLen);
51 
52 #endif // BASE64_H
base64_Encode
char * base64_Encode(const unsigned char *src, size_t len)
convert blob of binary data to ascii base64-encoded equivalent
Definition: _base64.cpp:37
base64_Decode
unsigned char * base64_Decode(const char *src, size_t *len)
decode base64 encoded data to binary equivalent
Definition: _base64.cpp:172