forked from mcu-tools/mcuboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign.sh
executable file
·48 lines (42 loc) · 1.14 KB
/
sign.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/sh
# This script can be used as an example of how to sign images.
source $(dirname $0)/target.sh
# RSA signatures can be made with the signing script in the scripts
# directory.
if true; then
./scripts/zep2newt.py \
--bin ../zephyr/samples/shell/outdir/$BOARD/zephyr.bin \
--key root.pem \
--sig RSA \
--out shell.signed.bin \
--vtoff 0x200 \
--word-size 8 \
--image-version 3 \
--bit --pad 0x20000
./scripts/zep2newt.py \
--bin ../zephyr/samples/hello_world/outdir/$BOARD/zephyr.bin \
--key root.pem \
--sig RSA \
--vtoff 0x200 \
--word-size 8 \
--image-version 2 \
--out hello.signed.bin
fi
# Currently, ECDSA signatures need to be made with the imgtool. See
# 'imgtool' for instructions on building the tool.
if false; then
imgtool sign \
--key root_ec.pem \
--header-size 0x200 \
--version 3.0 \
--align 8 \
--pad 0x20000 \
../zephyr/samples/shell/outdir/$BOARD/zephyr.bin \
shell.signed.bin
imgtool sign \
--key root_ec.pem \
--header-size 0x200 \
--version 3.0 \
../zephyr/samples/hello_world/outdir/$BOARD/zephyr.bin \
hello.signed.bin
fi