@@ -710,10 +710,10 @@ repo](https://github.com/theupdateframework/specification/issues).
710
710
711
711
* ** 4.4. File formats: snapshot.json**
712
712
713
- The snapshot.json file is signed by the snapshot role. It lists the version
714
- numbers of all metadata on the repository, excluding timestamp.json and
715
- mirrors.json. For the root role, the hash(es), size, and version number
716
- are listed.
713
+ The snapshot.json file is signed by the snapshot role. It lists the version
714
+ numbers, and optionally the size, of all metadata on the repository,
715
+ excluding root.json, timestamp.json and mirrors.json. For delegated roles,
716
+ the hash(es) are also listed.
717
717
718
718
The "signed" portion of snapshot.json is as follows:
719
719
@@ -727,43 +727,58 @@ repo](https://github.com/theupdateframework/specification/issues).
727
727
METAFILES is an object whose format is the following:
728
728
729
729
{ METAPATH : {
730
- "version" : VERSION }
730
+ "version" : VERSION,
731
+ "length" : LENGTH,
732
+ "hashes" : HASHES,
733
+ ("custom" : { ... }) }
731
734
, ...
732
735
}
733
736
734
737
METAPATH is the metadata file's path on the repository relative to the
735
738
metadata base URL.
736
739
737
- VERSION is listed for the root file
738
- and all other roles available on the repository.
740
+ VERSION is listed for all roles available on the repository.
741
+
742
+ LENGTH is the optional integer length in bytes of the file. It is optional
743
+ for all roles.
744
+
745
+ HASHES is a dictionary that specifies one or more hashes, including
746
+ the cryptographic hash function. For example: { "sha256": HASH, ... }. It
747
+ is required for delegated roles, and optional for all others.
739
748
740
749
A snapshot.json example file:
741
750
742
- {
743
- "signatures": [
744
- {
745
- "keyid": "66676daa73bdfb4804b56070c8927ae491e2a6c2314f05b854dea94de8ff6bfc",
746
- "sig": "f7f03b13e3f4a78a23561419fc0dd741a637e49ee671251be9f8f3fceedfc112e4
747
- 4ee3aaff2278fad9164ab039118d4dc53f22f94900dae9a147aa4d35dcfc0f"
748
- }
749
- ],
750
- "signed": {
751
- "_type": "snapshot",
752
- "spec_version": "1.0.0",
753
- "expires": "2030-01-01T00:00:00Z",
754
- "meta": {
755
- "root.json": {
756
- "version": 1
757
- },
758
- "targets.json": {
759
- "version": 1
760
- },
761
- "project.json": {
762
- "version": 1
763
- },
751
+ { "signatures": [
752
+ {
753
+ "keyid": "66676daa73bdfb4804b56070c8927ae491e2a6c2314f05b854dea94de8ff6bfc",
754
+ "sig": "f7f03b13e3f4a78a23561419fc0dd741a637e49ee671251be9f8f3fceedfc112e4
755
+ 4ee3aaff2278fad9164ab039118d4dc53f22f94900dae9a147aa4d35dcfc0f"
764
756
}
765
- "version": 1
766
- },
757
+ ],
758
+ "signed": {
759
+ "_type": "snapshot",
760
+ "spec_version": "1.0.0",
761
+ "expires": "2030-01-01T00:00:00Z",
762
+ "meta": {
763
+ "targets.json": {
764
+ "version": 1
765
+ },
766
+ "project1.json": {
767
+ "version": 1,
768
+ "hashes": {
769
+ "sha256": "f592d072e1193688a686267e8e10d7257b4ebfcf28133350dae88362d82a0c8a"
770
+ }
771
+ },
772
+ "project2.json": {
773
+ "version": 1,
774
+ "length": 604,
775
+ "hashes": {
776
+ "sha256": "1f812e378264c3085bb69ec5f6663ed21e5882bbece3c3f8a0e8479f205ffb91"
777
+ }
778
+ }
779
+ },
780
+ "version": 1
781
+ }
767
782
}
768
783
769
784
* ** 4.5. File formats: targets.json and delegated target roles**
0 commit comments