Add Profile::IsChild and IsLegacySupervised
[chromium-blink-merge.git] / components / ownership / owner_key_util_impl.h
blob9358cca52bec8a504336d6c771fc31ada90b9995
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_
6 #define COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_
8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h"
10 #include "base/macros.h"
11 #include "components/ownership/owner_key_util.h"
12 #include "components/ownership/ownership_export.h"
14 namespace ownership {
16 // Implementation of OwnerKeyUtil which imports public part of the
17 // owner key from a filesystem.
18 class OWNERSHIP_EXPORT OwnerKeyUtilImpl : public OwnerKeyUtil {
19 public:
20 explicit OwnerKeyUtilImpl(const base::FilePath& public_key_file);
22 // OwnerKeyUtil implementation:
23 bool ImportPublicKey(std::vector<uint8>* output) override;
24 #if defined(USE_NSS)
25 crypto::RSAPrivateKey* FindPrivateKeyInSlot(const std::vector<uint8>& key,
26 PK11SlotInfo* slot) override;
27 #endif // defined(USE_NSS)
28 bool IsPublicKeyPresent() override;
30 private:
31 ~OwnerKeyUtilImpl() override;
33 // The file that holds the public key.
34 base::FilePath public_key_file_;
36 DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilImpl);
39 } // namespace ownership
41 #endif // COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_