-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcryptohome_client.h
44 lines (32 loc) · 1.12 KB
/
cryptohome_client.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2018 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 AUTHPOLICY_CRYPTOHOME_CLIENT_H_
#define AUTHPOLICY_CRYPTOHOME_CLIENT_H_
#include <string>
#include <base/macros.h>
namespace dbus {
class ObjectProxy;
}
namespace brillo {
namespace dbus_utils {
class DBusObject;
}
} // namespace brillo
namespace authpolicy {
// Exposes methods from the Cryptohome daemon.
class CryptohomeClient {
public:
explicit CryptohomeClient(brillo::dbus_utils::DBusObject* dbus_object);
CryptohomeClient(const CryptohomeClient&) = delete;
CryptohomeClient& operator=(const CryptohomeClient&) = delete;
virtual ~CryptohomeClient();
// Exposes Cryptohome's GetSanitizedUsername(). This is a 32-byte lowercase
// hex string that is also used as user directory. Returns an empty string on
// error.
std::string GetSanitizedUsername(const std::string& account_id_key);
private:
dbus::ObjectProxy* cryptohome_proxy_ = nullptr; // Not owned.
};
} // namespace authpolicy
#endif // AUTHPOLICY_CRYPTOHOME_CLIENT_H_