blob: 5c9989e2aa30d815c44cb59caea218849345068e [file] [log] [blame]
David Brown22a6fe32017-01-10 10:40:43 -07001#! /bin/sh
2
David Brown3869e762017-02-02 08:10:23 -07003# This script can be used as an example of how to sign images.
4
David Brown22a6fe32017-01-10 10:40:43 -07005source $(dirname $0)/target.sh
6
David Brown3869e762017-02-02 08:10:23 -07007# RSA signatures can be made with the signing script in the scripts
8# directory.
9if true; then
10 ./scripts/zep2newt.py \
11 --bin ../zephyr/samples/shell/outdir/$BOARD/zephyr.bin \
12 --key root.pem \
13 --sig RSA \
14 --out shell.signed.bin \
15 --vtoff 0x200 \
16 --word-size 8 \
17 --image-version 3 \
18 --bit --pad 0x20000
David Brown22a6fe32017-01-10 10:40:43 -070019
David Brown3869e762017-02-02 08:10:23 -070020 ./scripts/zep2newt.py \
21 --bin ../zephyr/samples/hello_world/outdir/$BOARD/zephyr.bin \
22 --key root.pem \
23 --sig RSA \
24 --vtoff 0x200 \
25 --word-size 8 \
26 --image-version 2 \
27 --out hello.signed.bin
28fi
29
30# Currently, ECDSA signatures need to be made with the imgtool. See
31# 'imgtool' for instructions on building the tool.
32if false; then
33 imgtool sign \
34 --key root_ec.pem \
35 --header-size 0x200 \
36 --version 3.0 \
37 --align 8 \
38 --pad 0x20000 \
39 ../zephyr/samples/shell/outdir/$BOARD/zephyr.bin \
40 shell.signed.bin
41
42 imgtool sign \
43 --key root_ec.pem \
44 --header-size 0x200 \
45 --version 3.0 \
46 ../zephyr/samples/hello_world/outdir/$BOARD/zephyr.bin \
47 hello.signed.bin
48fi