Fix build error for aarch64
[platform/core/security/ode.git] / server / engine / encryption / ecryptfs-engine.h
1 /*
2  *  Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef __ECRYPTFS_ENGINE_H__
18 #define __ECRYPTFS_ENGINE_H__
19
20 #include <vector>
21 #include <string>
22
23 #include "progress-bar.h"
24
25 namespace ode {
26
27 class EcryptfsEngine final {
28 public:
29         EcryptfsEngine(const std::string& src, const std::string& dest, const ProgressBar& prgs);
30         EcryptfsEngine(const EcryptfsEngine&) = delete;
31         EcryptfsEngine(EcryptfsEngine&&) = delete;
32         ~EcryptfsEngine();
33
34         EcryptfsEngine& operator=(const EcryptfsEngine&) = delete;
35         EcryptfsEngine& operator=(EcryptfsEngine&&) = delete;
36
37         const std::string& getSource()
38         {
39                 return source;
40         }
41
42         const std::string& getDestination()
43         {
44                 return destination;
45         }
46
47         typedef std::vector<unsigned char> data;
48
49         void mount(const data& key, unsigned int);
50         void umount();
51
52         void encrypt(const data& key, unsigned int);
53         void decrypt(const data& key, unsigned int);
54
55         bool isKeyMetaSet();
56         const data getKeyMeta();
57         void setKeyMeta(const data &data);
58         void clearKeyMeta();
59
60         unsigned int getSupportedOptions();
61
62 private:
63         std::string source, destination;
64         ProgressBar progress;
65 };
66
67 } // namespace ode
68 #endif // __ECRYPTFS_ENGINE_H__
69