summaryrefslogtreecommitdiff
path: root/common/tpm_manager_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/tpm_manager_interface.h')
-rw-r--r--common/tpm_manager_interface.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/common/tpm_manager_interface.h b/common/tpm_manager_interface.h
new file mode 100644
index 0000000..bee631f
--- /dev/null
+++ b/common/tpm_manager_interface.h
@@ -0,0 +1,38 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TPM_MANAGER_COMMON_TPM_MANAGER_INTERFACE_H_
+#define TPM_MANAGER_COMMON_TPM_MANAGER_INTERFACE_H_
+
+#include <base/callback.h>
+
+#include "tpm_manager/common/dbus_interface.pb.h"
+#include "tpm_manager/common/export.h"
+
+namespace tpm_manager {
+
+// This is the main TpmManager interface that is implemented by the proxies
+// and services.
+class TPM_MANAGER_EXPORT TpmManagerInterface {
+ public:
+ virtual ~TpmManagerInterface() = default;
+
+ // Performs initialization tasks. This method must be called before calling
+ // any other method on this interface.
+ virtual bool Initialize() = 0;
+
+ // Processes a GetTpmStatusRequest and responds with a GetTpmStatusReply.
+ using GetTpmStatusCallback = base::Callback<void(const GetTpmStatusReply&)>;
+ virtual void GetTpmStatus(const GetTpmStatusRequest& request,
+ const GetTpmStatusCallback& callback) = 0;
+
+ // Processes a TakeOwnershipRequest and responds with a TakeOwnershipReply.
+ using TakeOwnershipCallback = base::Callback<void(const TakeOwnershipReply&)>;
+ virtual void TakeOwnership(const TakeOwnershipRequest& request,
+ const TakeOwnershipCallback& callback) = 0;
+};
+
+} // namespace tpm_manager
+
+#endif // TPM_MANAGER_COMMON_TPM_MANAGER_INTERFACE_H_