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.
7 option optimize_for = LITE_RUNTIME;
11 // A CRX₃ file is a binary file of the following format:
12 // [4 octets]: "Cr24", a magic number.
13 // [4 octets]: The version of the *.crx file format used (currently 3).
14 // [4 octets]: N, little-endian, the length of the header section.
15 // [N octets]: The header (the binary encoding of a CrxFileHeader).
16 // [M octets]: The ZIP archive.
17 // Clients should reject CRX₃ files that contain an N that is too large for the
18 // client to safely handle in memory.
20 message CrxFileHeader {
21 // PSS signature with RSA public key. The public key is formatted as a
22 // X.509 SubjectPublicKeyInfo block, as in CRX₂. In the common case of a
23 // developer key proof, the first 128 bits of the SHA-256 hash of the
24 // public key must equal the crx_id.
25 repeated AsymmetricKeyProof sha256_with_rsa = 2;
27 // ECDSA signature, using the NIST P-256 curve. Public key appears in
28 // named-curve format.
29 // The pinned algorithm will be this, at least on 2017-01-01.
30 repeated AsymmetricKeyProof sha256_with_ecdsa = 3;
32 // A verified contents file containing signatures over the archive contents.
33 // The verified contents are encoded in UTF-8 and then GZIP-compressed.
35 // https://source.chromium.org/chromium/chromium/src/+/main:extensions/browser/verified_contents.h
36 // for information about the verified contents format.
37 optional bytes verified_contents = 4;
39 // The binary form of a SignedData message. We do not use a nested
40 // SignedData message, as handlers of this message must verify the proofs
41 // on exactly these bytes, so it is convenient to parse in two steps.
43 // All proofs in this CrxFile message are on the value
44 // "CRX3 SignedData\x00" + signed_header_size + signed_header_data +
45 // archive, where "\x00" indicates an octet with value 0, "CRX3 SignedData"
46 // is encoded using UTF-8, signed_header_size is the size in octets of the
47 // contents of this field and is encoded using 4 octets in little-endian
48 // order, signed_header_data is exactly the content of this field, and
49 // archive is the remaining contents of the file following the header.
50 optional bytes signed_header_data = 10000;
53 message AsymmetricKeyProof {
54 optional bytes public_key = 1;
55 optional bytes signature = 2;
59 // This is simple binary, not UTF-8 encoded mpdecimal; i.e. it is exactly
61 optional bytes crx_id = 1;