David Brown | 22a6fe3 | 2017-01-10 10:40:43 -0700 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 3 | # This script can be used as an example of how to sign images. |
| 4 | |
David Brown | 22a6fe3 | 2017-01-10 10:40:43 -0700 | [diff] [blame] | 5 | source $(dirname $0)/target.sh |
| 6 | |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 7 | # RSA signatures can be made with the signing script in the scripts |
| 8 | # directory. |
| 9 | if 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 Brown | 22a6fe3 | 2017-01-10 10:40:43 -0700 | [diff] [blame] | 19 | |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 20 | ./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 |
| 28 | fi |
| 29 | |
| 30 | # Currently, ECDSA signatures need to be made with the imgtool. See |
| 31 | # 'imgtool' for instructions on building the tool. |
| 32 | if 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 |
| 48 | fi |