Fix coverity issue
[platform/core/security/ode.git] / lib / external-encryption.h
1 /*
2  *  Copyright (c) 2015-2017 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 __EXTERNAL_ENCRYPTION_CLIENT_H__
18 #define __EXTERNAL_ENCRYPTION_CLIENT_H__
19
20 #include <string>
21
22 #include "rmi/external-encryption.h"
23 #include "client.h"
24
25 namespace ode {
26
27 class ExternalEncryptionClient final: public ExternalEncryption {
28 public:
29         ExternalEncryptionClient(RmiClientPtr& ctxt);
30         ~ExternalEncryptionClient();
31
32         int setMountPassword(const std::string& password);
33
34         int mount();
35         int umount();
36
37         int encrypt(const std::string& password, unsigned int options);
38         int decrypt(const std::string& password);
39
40         int recovery();
41
42         int isPasswordInitialized();
43         int initPassword(const std::string& password);
44         int cleanPassword(const std::string& password);
45         int changePassword(const std::string& oldPW, const std::string& newPW);
46         int verifyPassword(const std::string& password);
47
48         int getState();
49
50         unsigned int getSupportedOptions();
51
52         std::string getDevicePath() const;
53
54 private:
55         RmiClientPtr& context;
56 };
57
58 } // namespace ode
59
60 #endif // __EXTERNAL_ENCRYPTION_CLIENT_H__