2 * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
18 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
20 * @brief Sample service implementation.
22 #include <ckm/ckm-error.h>
23 #include <ckm/ckm-type.h>
25 #include <ckm-logic.h>
28 CKMLogic::CKMLogic(){}
29 CKMLogic::~CKMLogic(){}
31 RawBuffer CKMLogic::unlockUserKey(const std::string &user, const RawBuffer &password) {
37 RawBuffer CKMLogic::lockUserKey(const std::string &user) {
42 RawBuffer CKMLogic::removeUserData(const std::string &user) {
47 RawBuffer CKMLogic::changeUserPassword(
48 const std::string &user,
49 const RawBuffer &oldPassword,
50 const RawBuffer &newPassword)
58 RawBuffer CKMLogic::resetUserPassword(
59 const std::string &user,
60 const RawBuffer &newPassword)
67 RawBuffer CKMLogic::saveData(
73 const PolicySerializable &policy)
80 MessageBuffer response;
81 Serialization::Serialize(response, static_cast<int>(LogicCommand::SAVE));
82 Serialization::Serialize(response, commandId);
83 Serialization::Serialize(response, static_cast<int>(KEY_MANAGER_API_SUCCESS));
84 Serialization::Serialize(response, static_cast<int>(dataType));
86 return response.Pop();
89 RawBuffer CKMLogic::removeData(
98 MessageBuffer response;
99 Serialization::Serialize(response, static_cast<int>(LogicCommand::REMOVE));
100 Serialization::Serialize(response, commandId);
101 Serialization::Serialize(response, static_cast<int>(KEY_MANAGER_API_SUCCESS));
102 Serialization::Serialize(response, static_cast<int>(dataType));
104 return response.Pop();
107 RawBuffer CKMLogic::getData(
112 const RawData &password)
118 MessageBuffer response;
119 Serialization::Serialize(response, static_cast<int>(LogicCommand::GET));
120 Serialization::Serialize(response, commandId);
121 Serialization::Serialize(response, static_cast<int>(KEY_MANAGER_API_SUCCESS));
122 Serialization::Serialize(response, static_cast<int>(dataType));
123 Serialization::Serialize(response, RawData());
124 return response.Pop();