OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ | 5 #ifndef COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ |
6 #define COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ | 6 #define COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "components/ownership/owner_key_util.h" | 13 #include "components/ownership/owner_key_util.h" |
12 #include "components/ownership/ownership_export.h" | 14 #include "components/ownership/ownership_export.h" |
13 | 15 |
14 namespace ownership { | 16 namespace ownership { |
15 | 17 |
16 // Implementation of OwnerKeyUtil which imports public part of the | 18 // Implementation of OwnerKeyUtil which imports public part of the |
17 // owner key from a filesystem. | 19 // owner key from a filesystem. |
18 class OWNERSHIP_EXPORT OwnerKeyUtilImpl : public OwnerKeyUtil { | 20 class OWNERSHIP_EXPORT OwnerKeyUtilImpl : public OwnerKeyUtil { |
19 public: | 21 public: |
20 explicit OwnerKeyUtilImpl(const base::FilePath& public_key_file); | 22 explicit OwnerKeyUtilImpl(const base::FilePath& public_key_file); |
21 | 23 |
22 // OwnerKeyUtil implementation: | 24 // OwnerKeyUtil implementation: |
23 bool ImportPublicKey(std::vector<uint8>* output) override; | 25 bool ImportPublicKey(std::vector<uint8_t>* output) override; |
24 crypto::ScopedSECKEYPrivateKey FindPrivateKeyInSlot( | 26 crypto::ScopedSECKEYPrivateKey FindPrivateKeyInSlot( |
25 const std::vector<uint8>& key, | 27 const std::vector<uint8_t>& key, |
26 PK11SlotInfo* slot) override; | 28 PK11SlotInfo* slot) override; |
27 bool IsPublicKeyPresent() override; | 29 bool IsPublicKeyPresent() override; |
28 | 30 |
29 private: | 31 private: |
30 ~OwnerKeyUtilImpl() override; | 32 ~OwnerKeyUtilImpl() override; |
31 | 33 |
32 // The file that holds the public key. | 34 // The file that holds the public key. |
33 base::FilePath public_key_file_; | 35 base::FilePath public_key_file_; |
34 | 36 |
35 DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilImpl); | 37 DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilImpl); |
36 }; | 38 }; |
37 | 39 |
38 } // namespace ownership | 40 } // namespace ownership |
39 | 41 |
40 #endif // COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ | 42 #endif // COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ |
OLD | NEW |