Joshua Pawlicki | b8bc9f9 | 2017-10-16 17:23:52 | [diff] [blame] | 1 | // Copyright 2017 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 | #ifndef COMPONENTS_CRX_FILE_CRX_CREATOR_H_ |
| 6 | #define COMPONENTS_CRX_FILE_CRX_CREATOR_H_ |
| 7 | |
| 8 | namespace base { |
| 9 | class FilePath; |
| 10 | } // namespace base |
| 11 | |
| 12 | namespace crypto { |
| 13 | class RSAPrivateKey; |
| 14 | } // namespace crypto |
| 15 | |
| 16 | namespace crx_file { |
| 17 | |
| 18 | enum class CreatorResult { |
| 19 | OK, // The CRX file was successfully created. |
| 20 | ERROR_SIGNING_FAILURE, |
| 21 | ERROR_FILE_NOT_READABLE, |
| 22 | ERROR_FILE_NOT_WRITABLE, |
| 23 | ERROR_FILE_WRITE_FAILURE, |
| 24 | }; |
| 25 | |
| 26 | // Create a CRX3 file at |output_path|, using the contents of the ZIP archive |
| 27 | // located at |zip_path| and signing with (and deriving the CRX ID from) |
| 28 | // |signing_key|. |
| 29 | CreatorResult Create(const base::FilePath& output_path, |
| 30 | const base::FilePath& zip_path, |
| 31 | crypto::RSAPrivateKey* signing_key); |
| 32 | |
| 33 | } // namespace crx_file |
| 34 | |
| 35 | #endif // COMPONENTS_CRX_FILE_CRX_CREATOR_H_ |