Implement key retrieval in encryption service
[platform/core/security/key-manager.git] / src / manager / service / encryption-service.h
index 70146a1..73140b7 100644 (file)
 
 #pragma once
 
-#include <thread-service.h>
+#include <message-service.h>
 #include <noncopyable.h>
 #include <iencryption-service.h>
 #include <encryption-logic.h>
+#include <service-messages.h>
 
 namespace CKM {
 
-class EncryptionService : public ThreadService, public IEncryptionService
+class EncryptionService : public ThreadMessageService<MsgKeyResponse>, public IEncryptionService
 {
 public:
     EncryptionService();
@@ -40,8 +41,12 @@ public:
 
     void Start();
     void Stop();
+
 private:
+    virtual void SetCommManager(CommMgr *manager);
+
     bool ProcessOne(const ConnectionID &conn, ConnectionInfo &info);
+    void ProcessMessage(MsgKeyResponse msg);
     void ProcessEncryption(const ConnectionID &conn,
                            const Credentials &cred,
                            MessageBuffer &buffer);
@@ -50,9 +55,7 @@ private:
     virtual void RespondToClient(const CryptoRequest& request,
                                  int retCode,
                                  const RawBuffer& data = RawBuffer());
-    virtual void RequestKey(const Credentials& cred,
-                            const Alias& alias,
-                            const Label& label);
+    virtual void RequestKey(const CryptoRequest& request);
 
     EncryptionLogic m_logic;
 };