OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #include "components/ownership/owner_key_util.h" | |
6 | |
7 #include <limits> | |
8 | |
9 #include "base/file_util.h" | |
10 #include "base/logging.h" | |
11 #include "base/path_service.h" | |
12 #include "base/sys_info.h" | |
13 #include "crypto/rsa_private_key.h" | |
14 | |
15 #if defined(OS_CHROMEOS) | |
16 #include "chromeos/chromeos_paths.h" | |
17 #include "components/ownership/owner_key_util_chromeos.h" | |
18 #endif // defined(OS_CHROMEOS) | |
19 | |
20 namespace ownership { | |
21 | |
22 /////////////////////////////////////////////////////////////////////////// | |
23 // PublicKey | |
24 | |
25 PublicKey::PublicKey() { | |
26 } | |
27 | |
28 PublicKey::~PublicKey() { | |
29 } | |
30 | |
31 /////////////////////////////////////////////////////////////////////////// | |
32 // PrivateKey | |
33 | |
34 PrivateKey::PrivateKey(crypto::RSAPrivateKey* key) : key_(key) { | |
35 } | |
36 | |
37 PrivateKey::~PrivateKey() { | |
38 } | |
39 | |
40 /////////////////////////////////////////////////////////////////////////// | |
41 // OwnerKeyUtil | |
42 | |
43 OwnerKeyUtil* OwnerKeyUtil::Create() { | |
44 #if defined(OS_CHROMEOS) | |
45 base::FilePath owner_key_path; | |
erikwright (departed)
2014/08/25 15:51:07
Accept this path as an input from the caller.
ygorshenin1
2014/08/26 14:53:35
Done.
| |
46 CHECK(PathService::Get(chromeos::FILE_OWNER_KEY, &owner_key_path)); | |
stevenjb
2014/08/25 15:57:30
nit: I am not a fan of assertions with side effect
ygorshenin1
2014/08/26 14:53:35
Done.
| |
47 return new OwnerKeyUtilChromeOS(owner_key_path); | |
stevenjb
2014/08/25 15:57:29
nit: You could #ifdef out all of Create for OS_CHR
ygorshenin1
2014/08/26 14:53:35
Done.
| |
48 #else | |
49 return NULL; | |
50 #endif // defined(OS_CHROMEOS) | |
51 } | |
52 | |
53 OwnerKeyUtil::OwnerKeyUtil() { | |
54 } | |
55 | |
56 OwnerKeyUtil::~OwnerKeyUtil() { | |
57 } | |
58 | |
59 /////////////////////////////////////////////////////////////////////////// | |
60 // OwnerKeyUtilImpl | |
61 | |
62 } // namespace ownership | |
OLD | NEW |