Index: components/ownership/owner_key_util_impl.h |
diff --git a/components/ownership/owner_key_util_impl.h b/components/ownership/owner_key_util_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7b79ef0e7328f1ff1ff871dad4c398074946bd98 |
--- /dev/null |
+++ b/components/ownership/owner_key_util_impl.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2014 The Chromium 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 COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ |
+#define COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ |
+ |
+#include "base/basictypes.h" |
erikwright (departed)
2014/08/28 18:39:58
what do you need from basictypes that's not in mac
ygorshenin1
2014/08/28 18:59:05
Nothing, I forget to remove it, sorry.
On 2014/08
|
+#include "base/compiler_specific.h" |
+#include "base/files/file_path.h" |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
erikwright (departed)
2014/08/28 18:39:58
not required.
ygorshenin1
2014/08/28 18:59:05
Done.
|
+#include "components/ownership/owner_key_util.h" |
+#include "components/ownership/ownership_export.h" |
+ |
+namespace ownership { |
+ |
+class OWNERSHIP_EXPORT OwnerKeyUtilImpl : public OwnerKeyUtil { |
+ public: |
+ explicit OwnerKeyUtilImpl(const base::FilePath& public_key_file); |
+ |
+ // Attempts to read the public key from the file system. Upon success, |
+ // returns true and populates |output|. False on failure. |
erikwright (departed)
2014/08/28 18:39:58
These comments should be in the pure-virtual file.
ygorshenin1
2014/08/28 18:59:05
Done.
|
+ virtual bool ImportPublicKey(std::vector<uint8>* output) OVERRIDE; |
+ |
+#if defined(USE_NSS) |
+ // Looks for the private key associated with |key| in the |slot| |
+ // and returns it if it can be found. Returns NULL otherwise. |
+ // Caller takes ownership. |
+ virtual crypto::RSAPrivateKey* FindPrivateKeyInSlot( |
+ const std::vector<uint8>& key, |
+ PK11SlotInfo* slot) OVERRIDE; |
+#endif // defined(USE_NSS) |
+ |
+ // Checks whether the public key is present in the file system. |
+ virtual bool IsPublicKeyPresent() OVERRIDE; |
+ |
+ protected: |
+ virtual ~OwnerKeyUtilImpl(); |
erikwright (departed)
2014/08/28 18:39:58
Since you don't have any 'friends' I guess this ca
ygorshenin1
2014/08/28 18:59:05
Done.
|
+ |
+ private: |
+ // The file that holds the public key. |
+ base::FilePath public_key_file_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilImpl); |
+}; |
+ |
+} // namespace ownership |
+ |
+#endif // COMPONENTS_OWNERSHIP_OWNER_KEY_UTIL_IMPL_H_ |