Fixed Klocworks issues
[platform/framework/native/appfw.git] / src / security / cert / FSecCert_Base64.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FSecCert_Base64.h
19  * @brief               This header file contains the declarations of Base64 Encode/Decode.
20  *
21  * This header file contains the declarations of Base64 Encode/Decode.
22  */
23
24 #ifndef _FSEC_CERT_INTERNAL_CERT_BASE64_H_
25 #define _FSEC_CERT_INTERNAL_CERT_BASE64_H_
26
27 #include "FSecCert_CertTypes.h"
28 #include "FBaseByteBuffer.h"
29
30 namespace Tizen { namespace Security { namespace Cert
31 {
32
33 class _Base64
34 {
35
36 public:
37         static int Decode(char* pIn, int inSize, byte* pOut, int& outSize);
38
39         static result Encode(byte* pIn, int inSize, char* pOut, int outSize);
40
41         static int GetEncodedSize(int length);
42
43         static int GetDecodedSize(int length);
44
45 private:
46         _Base64(void);
47
48         _Base64(const _Base64& rhs);
49
50         ~_Base64(void);
51
52         _Base64& operator =(const _Base64& rhs);
53
54         static byte GetBase64Code(byte c);
55
56 }; //_Base64
57
58 } } } //Tizen::Security::Cert
59
60 #endif // _FSEC_CERT_INTERNAL_CERT_BASE64_H_