blob: a8c209447cad09d01d5269d608d040a1977d0bcb [file] [log] [blame]
Joshua Pawlickib8bc9f92017-10-16 17:23:521// 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
8namespace base {
9class FilePath;
10} // namespace base
11
12namespace crypto {
13class RSAPrivateKey;
14} // namespace crypto
15
16namespace crx_file {
17
18enum 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|.
29CreatorResult 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_