| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_COMMON_EXTENSIONS_EXTENSION_CREATOR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CREATOR_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_CREATOR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CREATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class RSAPrivateKey; | 14 class RSAPrivateKey; |
| 15 } | 15 } |
| 16 | 16 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 44 const FilePath& private_key_output_path); | 44 const FilePath& private_key_output_path); |
| 45 | 45 |
| 46 // Reads private key from |private_key_path|. | 46 // Reads private key from |private_key_path|. |
| 47 base::RSAPrivateKey* ReadInputKey(const FilePath& private_key_path); | 47 base::RSAPrivateKey* ReadInputKey(const FilePath& private_key_path); |
| 48 | 48 |
| 49 // Generates a key pair and writes the private key to |private_key_path| | 49 // Generates a key pair and writes the private key to |private_key_path| |
| 50 // if provided. | 50 // if provided. |
| 51 base::RSAPrivateKey* GenerateKey(const FilePath& private_key_path); | 51 base::RSAPrivateKey* GenerateKey(const FilePath& private_key_path); |
| 52 | 52 |
| 53 // Creates temporary zip file for the extension. | 53 // Creates temporary zip file for the extension. |
| 54 bool CreateZip(const FilePath& extension_dir, FilePath* zip_path); | 54 bool CreateZip(const FilePath& extension_dir, const FilePath& temp_path, |
| 55 FilePath* zip_path); |
| 55 | 56 |
| 56 // Signs the temporary zip and returns the signature. | 57 // Signs the temporary zip and returns the signature. |
| 57 bool SignZip(const FilePath& zip_path, | 58 bool SignZip(const FilePath& zip_path, |
| 58 base::RSAPrivateKey* private_key, | 59 base::RSAPrivateKey* private_key, |
| 59 std::vector<uint8>* signature); | 60 std::vector<uint8>* signature); |
| 60 | 61 |
| 61 // Export installable .crx to |crx_path|. | 62 // Export installable .crx to |crx_path|. |
| 62 bool WriteCRX(const FilePath& zip_path, | 63 bool WriteCRX(const FilePath& zip_path, |
| 63 base::RSAPrivateKey* private_key, | 64 base::RSAPrivateKey* private_key, |
| 64 const std::vector<uint8>& signature, | 65 const std::vector<uint8>& signature, |
| 65 const FilePath& crx_path); | 66 const FilePath& crx_path); |
| 66 | 67 |
| 67 // Holds a message for any error that is raised during Run(...). | 68 // Holds a message for any error that is raised during Run(...). |
| 68 std::string error_message_; | 69 std::string error_message_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(ExtensionCreator); | 71 DISALLOW_COPY_AND_ASSIGN(ExtensionCreator); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CREATOR_H_ | 74 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CREATOR_H_ |
| OLD | NEW |