SET(TARGET_KEY_MANAGER "key-manager")
SET(TARGET_KEY_MANAGER_CLIENT "key-manager-client")
+SET(TARGET_KEY_MANAGER_CONTROL_CLIENT "key-manager-control-client")
SET(TARGET_KEY_MANAGER_COMMON "key-manager-commons")
SET(TARGET_KEY_MANAGER_KEY_PROVIDER "key-manager-key-provider")
INSTALL(FILES
${CMAKE_SOURCE_DIR}/packaging/libkey-manager-client.manifest
+ ${CMAKE_SOURCE_DIR}/packaging/libkey-manager-control-client.manifest
${CMAKE_SOURCE_DIR}/packaging/key-manager.manifest
DESTINATION
/usr/share
Description: Central Key Manager Package
Version: 1.0.1
Requires: openssl libsmack
-Libs: -L${libdir} -lkey-manager-client -lsmack
+Libs: -L${libdir} -lkey-manager-client -lkey-manager-control-client -lsmack
Cflags: -I${includedir}/ckm
mkdir -p %{buildroot}/usr/share/license
cp LICENSE %{buildroot}/usr/share/license/%{name}
cp LICENSE %{buildroot}/usr/share/license/libkey-manager-client
+cp LICENSE %{buildroot}/usr/share/license/libkey-manager-control-client
mkdir -p %{buildroot}/etc/security/
%make_install
%files -n libkey-manager-client
%manifest %{_datadir}/libkey-manager-client.manifest
+%manifest %{_datadir}/libkey-manager-control-client.manifest
%defattr(-,root,root,-)
%{_libdir}/libkey-manager-client.so.*
+%{_libdir}/libkey-manager-control-client.so.*
%{_datadir}/license/libkey-manager-client
+%{_datadir}/license/libkey-manager-control-client
%files -n libkey-manager-client-devel
%defattr(-,root,root,-)
%{_libdir}/libkey-manager-client.so
+%{_libdir}/libkey-manager-control-client.so
%{_libdir}/libkey-manager-commons.so
%{_includedir}/ckm/ckm/key-manager.h
+%{_includedir}/ckm/ckm/key-manager-control.h
%{_includedir}/ckm/ckm/ckm-error.h
%{_includedir}/ckm/ckm/ckm-type.h
%{_libdir}/pkgconfig/*.pc
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_" />
+ </request>
+</manifest>
SET(KEY_MANAGER_CLIENT_SOURCES
${KEY_MANAGER_CLIENT_SRC_PATH}/client-certificate.cpp
- ${KEY_MANAGER_CLIENT_SRC_PATH}/client-control.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-echo.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
################################################################################
+SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
+SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
+
+SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
+
+INCLUDE_DIRECTORIES(
+ ${KEY_MANAGER_PATH}/client
+ ${KEY_MANAGER_PATH}/common
+ ${KEY_MANAGER_PATH}/dpl/core/include
+ ${KEY_MANAGER_PATH}/dpl/log/include
+ )
+
+SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
+ ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
+ ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
+ )
+
+ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
+
+SET_TARGET_PROPERTIES(
+ ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
+ PROPERTIES
+ COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
+ SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
+ VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
+ )
+
+TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
+ ${KEY_MANAGER_DEP_LIBRARIES}
+ ${TARGET_KEY_MANAGER_COMMON}
+ )
+
+################################################################################
INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
INSTALL(FILES
${KEY_MANAGER_SRC_PATH}/include/ckm/key-manager.h
+ ${KEY_MANAGER_SRC_PATH}/include/ckm/key-manager-control.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
DESTINATION /usr/include/ckm/ckm
--- /dev/null
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ *
+ *
+ * @file key-manager.h
+ * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
+ * @version 1.0
+ * @brief Main header file for client library.
+ */
+#pragma once
+
+#include <string>
+#include <vector>
+#include <memory>
+
+#include <ckm/ckm-error.h>
+#include <ckm/ckm-type.h>
+
+// Central Key Manager namespace
+namespace CKM {
+
+// used by login manager to unlock user data with global password
+class Control
+{
+public:
+ Control();
+ // decrypt user key with password
+ int unlockUserKey(uid_t user, const std::string &password) const;
+
+ // remove user key from memory
+ int lockUserKey(uid_t user) const;
+
+ // remove user data from Store and erase key used for encryption
+ int removeUserData(uid_t user) const;
+
+ // change password for user
+ 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(uid_t user, const std::string &newPassword) const;
+
+ virtual ~Control();
+private:
+ class ControlImpl;
+ std::shared_ptr<ControlImpl> m_impl;
+};
+
+} // namespace CKM
+
// Central Key Manager namespace
namespace CKM {
-// used by login manager to unlock user data with global password
-class Control
-{
-public:
- Control();
- // decrypt user key with password
- int unlockUserKey(uid_t user, const std::string &password) const;
-
- // remove user key from memory
- int lockUserKey(uid_t user) const;
-
- // remove user data from Store and erase key used for encryption
- int removeUserData(uid_t user) const;
-
- // change password for user
- 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(uid_t user, const std::string &newPassword) const;
-
- virtual ~Control();
-private:
- class ControlImpl;
- std::shared_ptr<ControlImpl> m_impl;
-};
-
class Key {
public:
Key();
#include <message-buffer.h>
#include <protocols.h>
-#include <ckm/key-manager.h>
+#include <ckm/key-manager-control.h>
namespace CKM {
#include <dpl/serialization.h>
#include <dpl/log/log.h>
#include <ckm/key-manager.h>
+#include <ckm/key-manager-control.h>
#include <ckm/ckm-error.h>
#include <ckm/ckm-type.h>
#include <key-provider.h>