Fixed Klocworks issues
[platform/framework/native/appfw.git] / src / security / cert / FSecCert_CertFileStore.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_CertFileStore.h
19  * @brief       This header file contains the declarations of storing certificates and private key in file system.
20  *
21  * This header file contains the declarations of storing certificates and private key in file system.
22  */
23
24 #ifndef _FSEC_CERT_INTERNAL_CERT_FILE_STORE_H_
25 #define _FSEC_CERT_INTERNAL_CERT_FILE_STORE_H_
26
27 #include <FBaseString.h>
28 #include "FSecCert_CertTypes.h"
29
30
31 namespace Tizen { namespace Security { namespace Cert
32 {
33
34 class _CertFileStore
35 {
36
37 public:
38         _CertFileStore(void);
39
40         _CertFileStore(_CertPathType pathType);
41
42         _CertFileStore(char* pFileName, _CertPathType pathType);
43
44         _CertFileStore(CertIdNo hCertHandle, _CertPathType pathType);
45
46         virtual ~_CertFileStore(void);
47
48         _CertPathType GetPathType(void);
49
50         Tizen::Base::String GetFilePath(void);
51
52         result SetFilePath(Tizen::Base::String& filePath);
53
54         result SetFileHandle(CertIdNo hCert, _CertPathType pathType);
55
56         result WriteToFile(byte* pData, int dataLen);
57
58         result DeleteFile(void);
59
60         result GetFileNameFromHandle(CertIdNo hCert, _CertPathType pathType, Tizen::Base::String& fileName);
61
62         result ReadFromFile(byte* pData, int& dataLen);
63
64 private:
65         _CertFileStore(const _CertFileStore& rhs);
66
67         _CertFileStore& operator =(const _CertFileStore& rhs);
68
69 private:
70         Tizen::Base::String __fileName;
71         CertIdNo __hCert;
72         _CertPathType __CertPathType;
73
74 }; //_CertFileStore
75
76 } } } //Tizen::Security::Cert
77
78 #endif // _FSEC_CERT_INTERNAL_CERT_FILE_STORE_H_