{"id":29014073,"url":"https://github.com/armmbed/suit-manifest-generator","last_synced_at":"2025-06-25T20:12:45.615Z","repository":{"id":54493019,"uuid":"125235750","full_name":"ARMmbed/suit-manifest-generator","owner":"ARMmbed","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-05T13:49:34.000Z","size":330,"stargazers_count":17,"open_issues_count":11,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-08-03T07:54:44.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ARMmbed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-14T15:40:55.000Z","updated_at":"2023-08-03T07:54:44.553Z","dependencies_parsed_at":"2023-01-21T02:03:45.720Z","dependency_job_id":null,"html_url":"https://github.com/ARMmbed/suit-manifest-generator","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/ARMmbed/suit-manifest-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARMmbed%2Fsuit-manifest-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARMmbed%2Fsuit-manifest-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARMmbed%2Fsuit-manifest-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARMmbed%2Fsuit-manifest-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ARMmbed","download_url":"https://codeload.github.com/ARMmbed/suit-manifest-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARMmbed%2Fsuit-manifest-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261945409,"owners_count":23234244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-25T20:12:44.236Z","updated_at":"2025-06-25T20:12:45.603Z","avatar_url":"https://github.com/ARMmbed.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migration: THIS REPO IS ARCHIVED\n\nThe suit-tool is being developed at: https://gitlab.arm.com/research/ietf-suit/suit-tool\n\nThe suit-parser is being developed at: https://gitlab.arm.com/research/ietf-suit/suit-parser\n\nThe core CBOR parser, used by suit-parser, is being developed at: https://gitlab.arm.com/research/ietf-suit/pull-cbor\n\n# Manifest Generator\n\nThis repository contains a tool to generate manifests following the specification in https://tools.ietf.org/html/draft-ietf-suit-manifest-09.\n\n# Installing\n\nFirst clone this repo:\n\n```\n$ git clone https://github.com/ARMmbed/suit-manifest-generator.git\n```\n\nNext, use pip to install the repo:\n\n```\n$ cd suit-manifest-generator\n$ python3 -m pip install --user --upgrade .\n```\n\n# Input File Description\n\nThe input file is organised into four high-level elements:\n\n* `manifest-version` (a positive integer), the version of the manifest specification\n* `manifest-sequence-number` (a positive integer), the anti-rollback counter of the manifest\n* `components`, a list of components that are described by the manifest\n\n\nEach component is a JSON map that may contain the following elements. Some elements are required for the target to be able to install the component.\n\nRequired elements:\n\n* `install-id` (a Component ID), the identifier of the location to install the described component.\n* `install-digest` (a SUIT Digest), the digest of the component after installation.\n* `install-size` (a positive integer), the size of the component after installation.\n* `vendor-id` (a RFC 4122 UUID), the UUID for the component vendor. This must match the UUID that the manifest processor expects for the specified `install-id`. The suit-tool expects at least one component to have a `vendor-id`\n* `class-id` (a RFC 4122 UUID), the UUID for the component. This must match the UUID that the manifest processor expects for the specified `install-id`. The `suit-tool` expects at least one component with a `vendor-id` to also have a `class-id`\n* `file` (a string), the path to a payload file. The `install-digest` and `install-size` will be calculated from this file.\n\nSome elements are not required by the tool, but are necessary in order to accomplish one or more use-cases.\n\nOptional elements:\n\n* `bootable` (a boolean, default: `false`), when set to true, the `suit-tool` will generate commands to execute the component, either from `install-id` or from `load-id` (see below)\n* `uri` (a text string), the location at which to find the payload. This element is required in order to generate the `payload-fetch` and `install` sections.\n* `loadable` (a boolean, default: `false`), when set to true, the `suit-tool` loads this component in the `load` section.\n* `compression-info` (a choice of string values), indicates how a payload is compressed. When specified, payload is decompressed before installation. The `install-size` must match the decompressed size of the payload and the install-digest must match the decompressed payload. N.B. The suit-tool does not perform compression. Supported values are:\n\n    * `gzip`\n    * `bzip2`\n    * `deflate`\n    * `lz4`\n    * `lzma`\n\n* `download-digest` (a SUIT Digest), a digest of the component after download. Only required if `compression-info` is present and `decompress-on-load` is `false`.\n* `decompress-on-load` (a boolean, default: `false`), when set to true, payload is not decompressed during installation. Instead, the payload is decompressed during loading. This element has no effect if `loadable` is `false`.\n* `load-digest` (a SUIT Digest), a digest of the component after loading. Only required if `decompress-on-load` is `true`.\n* `install-on-download` (boolean, default: true), If true, payload is written to `install-id` during download, otherwise, payload is written to `download-id`.\n* `download-id` (a component id), the location where a downloaded payload should be stored before installation--only used when `install-on-download` is `false`.\n\n## Component ID\n\nThe `suit-tool` expects component IDs to be a JSON list of strings. The `suit-tool` converts the strings to bytes by:\n\n1. Attempting to convert from hex\n2. Attempting to convert from base64\n3. Encoding the string to UTF-8\n\nFor example,\n\n* `[\"00\"]` will encode to `814100` (`[h'00']`)\n* `[\"0\"]` will encode to `814130` (`[h'30']`)\n* `[\"MTIzNA==\"]` will encode to `814431323334` (`[h'31323334']`)\n* `[\"example\"]` will encode to `81476578616D706C65` (`[h'6578616d706c65']`)\n\nN.B. Be careful that certain strings can appear to be hex or base64 and will be treated as such. Any characters outside the set `[0-9a-fA-F]` ensure that the string is not treated as hex. Any characters outside the set `[0-9A-Za-z+/]` or a number of characters not divisible by 4 will ensure that the string is not treated as base64.\n\n## SUIT Digest\n\nThe format of a digest is a JSON map:\n\n```JSON\n{\n    \"algorithm-id\" : \"sha256\",\n    \"digest-bytes\" : \"base64-or-hex\"\n}\n```\n\nThe `algorithm-id` must be one of:\n\n* `sha224`\n* `sha256`\n* `sha384`\n* `sha512`\n\nThe `digest-bytes` is a string of either hex- or base64-encoded bytes. The same decoding rules as those in Component ID are applied.\n\n## Example Input File\n\n```JSON\n{\n    \"components\" : [\n        {\n            \"download-id\" : [\"01\"],\n            \"install-id\" : [\"00\"],\n            \"install-digest\": {\n                \"algorithm-id\": \"sha256\",\n                \"digest-bytes\": \"00112233445566778899aabbccddeeff0123456789abcdeffedcba9876543210\"\n            },\n            \"install-size\" : 34768,\n            \"uri\": \"http://example.com/file.bin\",\n            \"vendor-id\" : \"fa6b4a53-d5ad-5fdf-be9d-e663e4d41ffe\",\n            \"class-id\" : \"1492af14-2569-5e48-bf42-9b2d51f2ab45\",\n            \"bootable\" : true,\n            \"install-on-download\" : false,\n            \"loadable\" : true,\n            \"decompress-on-load\" : true,\n            \"load-id\" : [\"02\"],\n            \"compression-info\" : \"gzip\",\n            \"load-digest\" : {\n                \"algorithm-id\": \"sha256\",\n                \"digest-bytes\": \"0011223344556677889901234567899876543210aabbccddeeffabcdeffedcba\"\n            }\n        },\n        {\n            \"install-id\" : [\"03\", \"01\"],\n            \"install-digest\": {\n                \"algorithm-id\": \"sha256\",\n                \"digest-bytes\": \"0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff\"\n            },\n            \"install-size\" : 76834,\n            \"uri\": \"http://example.com/file2.bin\"\n        }\n    ],\n    \"manifest-version\": 1,\n    \"manifest-sequence-number\": 7\n}\n```\n\n# Invoking the suit-tool\n\nThe `suit-tool` supports three sub-commands:\n\n* `create` generates a new manifest.\n* `sign` signs a manifest.\n* `parse` parses an existing manifest into cbor-debug or a json representation.\n* `keygen` Create a signing key. Not for production use.\n* `pubkey` Get the public key for a supplied private key in uECC-compatible C definition.\n\nThe `suit-tool` has a configurable log level, specified with `-l`:\n\n* `suit-tool -l debug` verbose output\n* `suit-tool -l info` normal output\n* `suit-tool -l warning` suppress informational messages\n* `suit-tool -l exception` suppress warning and informational messages\n\n## Create\n\nTo create a manifest, invoke the `suit-tool` with:\n\n```sh\nsuit-tool create -i IFILE -o OFILE\n```\n\nThe format of `IFILE` is as described above. `OFILE` defaults to a CBOR-encoded SUIT manifest.\n\n`-f` specifies the output format:\n\n* `suit`: CBOR-encoded SUIT manifest\n* `suit-debug`: CBOR-debug SUIT manifest\n* `json`: JSON-representation of a SUIT manifest\n\nThe `suit-tool` can generate a manifest with severable fields. To enable this mode, add the `-s` flag.\n\nTo add a component to the manifest from the command-line, use the following syntax:\n\n```\n-c 'FIELD1=VALUE1,FIELD2=VALUE2'\n```\n\nThe supported fields are:\n\n* `file` the path fo a file to use as a payload file.\n* `inst` the `install-id`.\n* `uri` the URI where the file will be found.\n\n## Sign\n\nTo sign an existing manifest, invoke the `suit-tool` with:\n\n```sh\nsuit-tool sign -m MANIFEST -k PRIVKEY -o OFILE\n```\n\n`PRIVKEY` must be a secp256r1 ECC private key in PEM format.\n\nIf the COSE Signature needs to indicate the key ID, add a key id with:\n\n```\n-i KEYID\n```\n\n## Parse\n\nTo parse an existing manifest, invoke the `suit-tool` with:\n\n```sh\nsuit-tool parse -m MANIFEST\n```\n\nIf a json-representation is needed, add the '-j' flag.\n\n## Keygen\n\nCreate an asymmetric keypair for non-production use. Production systems should use closely guarded keys, such as keys stored in an HSM.\n\n```sh\n suit-tool keygen [-t TYPE] -o KEYFILE\n ```\n\n`suit-tool keygen` defaults to creating SECP256r1 keys. To create another type of key, use `-t`followed by one of:\n\n* `secp256r1`\n* `secp384r1`\n* `secp521r1`\n* `ed25519`\n\n## UECC public key\n\nDerive a public key in the format used by micro ECC. The input is a PEM private key.\n\n```sh\nsuit-tool pubkey -k FILE\n```\n\nThe tool will then print the public key in micro ECC format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmmbed%2Fsuit-manifest-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmmbed%2Fsuit-manifest-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmmbed%2Fsuit-manifest-generator/lists"}