Android-cuttlefish cvd tool
secure_env_windows_lib.h
Go to the documentation of this file.
1//
2// Copyright (C) 2023 The Android Open Source Project
3//
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
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
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.
15
16#pragma once
17
18#include <windows.h>
19
20#if !defined(SECURE_ENV_DLL)
21#define SECURE_ENV_DLL_SYMBOL
22#elif defined(SECURE_ENV_BUILD_DLL)
23#define SECURE_ENV_DLL_SYMBOL __declspec(dllexport)
24#else
25#define SECURE_ENV_DLL_SYMBOL __declspec(dllimport)
26#endif
27
28namespace secure_env {
29extern "C" {
30/* Starts and runs remote keymaster and gatekeeper in separate threads.
31 * All cryptography is performed in software. Returns on failure, or once
32 * the connections are dropped on success.
33 *
34 */
35SECURE_ENV_DLL_SYMBOL bool StartSecureEnv(const char* keymaster_pipe,
36 const char* gatekeeper_pipe,
37 bool use_tpm);
38
39/* Starts and runs remote keymaster and gatekeeper using handles to preexisting
40 * async named pipes. Returns on failure, or once the connections are dropped on
41 * success.
42 */
44 HANDLE keymaster_pipe_handle, HANDLE gatekeeper_pipe_handle, bool use_tpm);
45}
46
47} // namespace secure_env
Definition: secure_env_windows_lib.cpp:35
bool StartSecureEnvWithHandles(HANDLE keymaster_pipe_handle, HANDLE gatekeeper_pipe_handle, bool)
Definition: secure_env_windows_lib.cpp:42
bool StartSecureEnv(const char *keymaster_pipe, const char *gatekeeper_pipe, bool use_tpm)
Definition: secure_env_windows_lib.cpp:95
#define SECURE_ENV_DLL_SYMBOL
Definition: secure_env_windows_lib.h:21