Add key-manager to manage device key and password
[platform/core/security/ode.git] / server / internal-encryption.cpp
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 #include <klay/filesystem.h>
17 #include <klay/audit/logger.h>
18
19 #include "engine/dmcrypt-engine.h"
20 #include "key-manager/key-manager.h"
21
22 #include "rmi/internal-encryption.h"
23
24 namespace ode {
25
26 InternalEncryption::InternalEncryption(ODEControlContext& ctx) :
27         context(ctx)
28 {
29         context.registerParametricMethod(this, "", (int)(InternalEncryption::mount)(std::string));
30         context.registerNonparametricMethod(this, "", (int)(InternalEncryption::umount));
31         context.registerParametricMethod(this, "", (int)(InternalEncryption::encrypt)(std::string));
32         context.registerParametricMethod(this, "", (int)(InternalEncryption::decrypt)(std::string));
33         context.registerParametricMethod(this, "", (int)(InternalEncryption::changePassword)(std::string, std::string));
34         context.registerNonparametricMethod(this, "", (int)(InternalEncryption::getState));
35 }
36
37
38 InternalEncryption::~InternalEncryption()
39 {
40 }
41
42 int InternalEncryption::mount(const std::string& password)
43 {
44         //TODO
45         return 0;
46 }
47
48 int InternalEncryption::umount()
49 {
50         //TODO
51         return 0;
52 }
53
54 int InternalEncryption::encrypt(const std::string& password)
55 {
56         //TODO
57         return 0;
58 }
59
60 int InternalEncryption::decrypt(const std::string& password)
61 {
62         //TODO
63         return 0;
64 }
65
66 int InternalEncryption::changePassword(const std::string& oldPassword,
67                                                                                 const std::string& newPassword)
68 {
69         //TODO
70         return 0;
71 }
72
73 int InternalEncryption::getState()
74 {
75         //TODO
76         return 0;
77 }
78
79 } // namespace ode