OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MOCK_OWNER_KEY_UTIL_H_ | 5 #ifndef COMPONENTS_OWNERSHIP_MOCK_OWNER_KEY_UTIL_H_ |
6 #define COMPONENTS_OWNERSHIP_MOCK_OWNER_KEY_UTIL_H_ | 6 #define COMPONENTS_OWNERSHIP_MOCK_OWNER_KEY_UTIL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "components/ownership/owner_key_util.h" | 16 #include "components/ownership/owner_key_util.h" |
17 #include "components/ownership/ownership_export.h" | 17 #include "components/ownership/ownership_export.h" |
18 | 18 |
19 namespace crypto { | 19 namespace crypto { |
20 class RSAPrivateKey; | 20 class RSAPrivateKey; |
21 } | 21 } |
22 | 22 |
23 namespace ownership { | 23 namespace ownership { |
24 | 24 |
25 // Implementation of OwnerKeyUtil which should be used only for | 25 // Implementation of OwnerKeyUtil which should be used only for |
(...skipping 13 matching lines...) Expand all Loading... |
39 void Clear(); | 39 void Clear(); |
40 | 40 |
41 // Configures the mock to return the given public key. | 41 // Configures the mock to return the given public key. |
42 void SetPublicKey(const std::vector<uint8_t>& key); | 42 void SetPublicKey(const std::vector<uint8_t>& key); |
43 | 43 |
44 // Sets the public key to use from the given private key, but doesn't | 44 // Sets the public key to use from the given private key, but doesn't |
45 // configure the private key. | 45 // configure the private key. |
46 void SetPublicKeyFromPrivateKey(const crypto::RSAPrivateKey& key); | 46 void SetPublicKeyFromPrivateKey(const crypto::RSAPrivateKey& key); |
47 | 47 |
48 // Sets the private key (also configures the public key). | 48 // Sets the private key (also configures the public key). |
49 void SetPrivateKey(scoped_ptr<crypto::RSAPrivateKey> key); | 49 void SetPrivateKey(std::unique_ptr<crypto::RSAPrivateKey> key); |
50 | 50 |
51 private: | 51 private: |
52 ~MockOwnerKeyUtil() override; | 52 ~MockOwnerKeyUtil() override; |
53 | 53 |
54 std::vector<uint8_t> public_key_; | 54 std::vector<uint8_t> public_key_; |
55 crypto::ScopedSECKEYPrivateKey private_key_; | 55 crypto::ScopedSECKEYPrivateKey private_key_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(MockOwnerKeyUtil); | 57 DISALLOW_COPY_AND_ASSIGN(MockOwnerKeyUtil); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace ownership | 60 } // namespace ownership |
61 | 61 |
62 #endif // COMPONENTS_OWNERSHIP_MOCK_OWNER_KEY_UTIL_H_ | 62 #endif // COMPONENTS_OWNERSHIP_MOCK_OWNER_KEY_UTIL_H_ |
OLD | NEW |