1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_CRX_FILE_CRX_CREATOR_H_
6 #define COMPONENTS_CRX_FILE_CRX_CREATOR_H_
20 enum class CreatorResult {
21 OK, // The CRX file was successfully created.
22 ERROR_SIGNING_FAILURE,
23 ERROR_FILE_NOT_READABLE,
24 ERROR_FILE_NOT_WRITABLE,
25 ERROR_FILE_WRITE_FAILURE,
28 // Similar to `Create` method but also injects `verified_contents` into the
30 CreatorResult CreateCrxWithVerifiedContentsInHeader(
31 const base::FilePath& output_path,
32 const base::FilePath& zip_path,
33 crypto::RSAPrivateKey* signing_key,
34 const std::string& verified_contents);
36 // Create a CRX3 file at |output_path|, using the contents of the ZIP archive
37 // located at |zip_path| and signing with (and deriving the CRX ID from)
39 CreatorResult Create(const base::FilePath& output_path,
40 const base::FilePath& zip_path,
41 crypto::RSAPrivateKey* signing_key);
43 } // namespace crx_file
45 #endif // COMPONENTS_CRX_FILE_CRX_CREATOR_H_