public:
Control();
// decrypt user key with password
- int unlockUserKey(const std::string &user, const std::string &password) const;
+ int unlockUserKey(uid_t user, const std::string &password) const;
// remove user key from memory
- int lockUserKey(const std::string &user) const;
+ int lockUserKey(uid_t user) const;
// remove user data from Store and erase key used for encryption
- int removeUserData(const std::string &user) const;
+ int removeUserData(uid_t user) const;
// change password for user
- int changeUserPassword(const std::string &user, const std::string &oldPassword, const std::string &newPassword) const;
+ int changeUserPassword(uid_t user, const std::string &oldPassword, const std::string &newPassword) const;
- // This is work around for security-server api - resetPassword that may be called without passing oldPassword.
- // This api should not be supported on tizen 3.0
- // User must be already logged in and his DKEK is already loaded into memory in plain text form.
- // The service will use DKEK in plain text and encrypt it in encrypted form (using new password).
- int resetUserPassword(const std::string &user, const std::string &newPassword) const;
+ // This is work around for security-server api - resetPassword that may be called without passing oldPassword.
+ // This api should not be supported on tizen 3.0
+ // User must be already logged in and his DKEK is already loaded into memory in plain text form.
+ // The service will use DKEK in plain text and encrypt it in encrypted form (using new password).
+ int resetUserPassword(uid_t user, const std::string &newPassword) const;
virtual ~Control();
private:
ControlImpl& operator=(const ControlImpl &) = delete;
ControlImpl& operator=(ControlImpl &&) = delete;
- static int unlockUserKey(const std::string &user, const std::string &password) {
+ static int unlockUserKey(uid_t user, const std::string &password) {
return try_catch([&] {
- if (user.empty())
- return KEY_MANAGER_API_ERROR_INPUT_PARAM;
-
MessageBuffer send, recv;
Serialization::Serialize(send, static_cast<int>(ControlCommand::UNLOCK_USER_KEY));
Serialization::Serialize(send, user);
});
}
- static int lockUserKey(const std::string &user) {
+ static int lockUserKey(uid_t user) {
return try_catch([&] {
- if (user.empty())
- return KEY_MANAGER_API_ERROR_INPUT_PARAM;
-
MessageBuffer send, recv;
Serialization::Serialize(send, static_cast<int>(ControlCommand::LOCK_USER_KEY));
Serialization::Serialize(send, user);
});
}
- static int removeUserData(const std::string &user) {
+ static int removeUserData(uid_t user) {
return try_catch([&] {
- if (user.empty())
- return KEY_MANAGER_API_ERROR_INPUT_PARAM;
-
MessageBuffer send, recv;
Serialization::Serialize(send, static_cast<int>(ControlCommand::REMOVE_USER_DATA));
Serialization::Serialize(send, user);
});
}
- static int changeUserPassword(const std::string &user, const std::string &oldPassword, const std::string &newPassword) {
+ static int changeUserPassword(uid_t user, const std::string &oldPassword, const std::string &newPassword) {
return try_catch([&] {
- if (user.empty())
- return KEY_MANAGER_API_ERROR_INPUT_PARAM;
-
MessageBuffer send, recv;
Serialization::Serialize(send, static_cast<int>(ControlCommand::CHANGE_USER_PASSWORD));
Serialization::Serialize(send, user);
});
}
- static int resetUserPassword(const std::string &user, const std::string &newPassword) {
+ static int resetUserPassword(uid_t user, const std::string &newPassword) {
return try_catch([&] {
- if (user.empty())
- return KEY_MANAGER_API_ERROR_INPUT_PARAM;
-
MessageBuffer send, recv;
Serialization::Serialize(send, static_cast<int>(ControlCommand::RESET_USER_PASSWORD));
Serialization::Serialize(send, user);
Control::~Control(){}
-int Control::unlockUserKey(const std::string &user, const std::string &password) const {
+int Control::unlockUserKey(uid_t user, const std::string &password) const {
return m_impl->unlockUserKey(user, password);
}
-int Control::lockUserKey(const std::string &user) const {
+int Control::lockUserKey(uid_t user) const {
return m_impl->lockUserKey(user);
}
-int Control::removeUserData(const std::string &user) const {
+int Control::removeUserData(uid_t user) const {
return m_impl->removeUserData(user);
}
-int Control::changeUserPassword(const std::string &user, const std::string &oldPassword, const std::string &newPassword) const {
+int Control::changeUserPassword(uid_t user, const std::string &oldPassword, const std::string &newPassword) const {
return m_impl->changeUserPassword(user, oldPassword, newPassword);
}
-int Control::resetUserPassword(const std::string &user, const std::string &newPassword) const {
+int Control::resetUserPassword(uid_t user, const std::string &newPassword) const {
return m_impl->resetUserPassword(user, newPassword);
}
CKMLogic::CKMLogic(){}
CKMLogic::~CKMLogic(){}
-RawBuffer CKMLogic::unlockUserKey(const std::string &user, const std::string &password) {
+RawBuffer CKMLogic::unlockUserKey(uid_t user, const std::string &password) {
(void)user;
(void)password;
return response.Pop();
}
-RawBuffer CKMLogic::lockUserKey(const std::string &user) {
+RawBuffer CKMLogic::lockUserKey(uid_t user) {
(void)user;
MessageBuffer response;
return response.Pop();
}
-RawBuffer CKMLogic::removeUserData(const std::string &user) {
+RawBuffer CKMLogic::removeUserData(uid_t user) {
(void)user;
MessageBuffer response;
}
RawBuffer CKMLogic::changeUserPassword(
- const std::string &user,
+ uid_t user,
const std::string &oldPassword,
const std::string &newPassword)
{
}
RawBuffer CKMLogic::resetUserPassword(
- const std::string &user,
+ uid_t user,
const std::string &newPassword)
{
(void)user;
#include <string>
#include <vector>
+
#include <message-buffer.h>
#include <protocols.h>
#include <ckm/ckm-type.h>
CKMLogic& operator=(CKMLogic &&) = delete;
virtual ~CKMLogic();
- RawBuffer unlockUserKey(const std::string &user, const std::string &password);
+ RawBuffer unlockUserKey(uid_t user, const std::string &password);
- RawBuffer lockUserKey(const std::string &user);
+ RawBuffer lockUserKey(uid_t user);
- RawBuffer removeUserData(const std::string &user);
+ RawBuffer removeUserData(uid_t user);
RawBuffer changeUserPassword(
- const std::string &user,
+ uid_t user,
const std::string &oldPassword,
const std::string &newPassword);
RawBuffer resetUserPassword(
- const std::string &user,
+ uid_t user,
const std::string &newPassword);
RawBuffer saveData(