Rockchip · AI & Linux Hub

Linux & boot

rk_sign_tool and sign_tool: prepare and verify signed Rockchip firmware

Signing prepares boot artifacts for an established trust chain. It is separate from programming a public-key hash into OTP/eFuse.

rk_sign_tool and sign_tool

sign_tool V1.0: signing, verification and external signing

This section converts the complete bundled command-line signing manual. Examples use sign_tool; they do not imply identical options in every rk_sign_tool version. Signing is distinct from OTP/eFuse programming. Flag 0x20 explicitly enables miniloader OTP writing and must be reviewed against the matching Secure Boot design.

SoC Digest Signature Padding
3229, 3228h, 3368, 3228, 3288, 3399, 3328 SHA256 RSA2048 NOPADD
3588, 3566, 3568, 3308, 3326, px30, 1808, 3228P, 1109, 1126, 2206 SHA256 RSA2048 PSSPADD

1. Preparation

Generate an RSA2048 key pair, explicitly with --bits=2048 or with the source default. Select the chip, then load the private/public keys. These choices are saved and need not be repeated if unchanged. 1126 and filenames below are examples.

sign_tool kk --bits=2048
sign_tool kk
sign_tool cc --chip=1126
sign_tool.exe lk --key private_key.pem --pubkey public_key.pem

Optional signing flags and the intermediate-data directory follow. The directory can also supply input for external signing. The two kk commands are alternatives, not an instruction to generate keys twice.

sign_tool ss --flag=0x20
sign_tool ss --out .\data_out

2. Sign and verify five object types

A complete update image is unpacked, its loader/uboot/boot/trust components signed, and repacked, which takes longer. For A/B schemes the tool must not sign boot: set exclude_boot_sign=true in setting.ini. Loader signing inserts security structures during unpack/repack. IDBlock is generated by mkimage and contains boot structures, DDR initialization and Boot code. DDR-test configurations and uboot/trust/boot images have separate commands.

sign_tool sf --firmware update.img
sign_tool vf --firmware update.img

sign_tool sl --loader miniloader.bin
sign_tool vl --loader miniloader.bin

sign_tool sb --idb 1126_idblock.bin
sign_tool vb --idb 1126_idblock.bin

sign_tool sd --cfg 1126_ddr_test.cfg
sign_tool vd --cfg 1126_ddr_test.cfg

sign_tool si --img uboot.img
sign_tool vi --img uboot.img

3.1 Extract data to sign

Extraction can use only the public key. Set extract and the output directory, then run any signing operation from section 2; the example extracts from update.img.

sign_tool ss --extract
sign_tool ss --out wait_sign_dir
sign_tool sf --firmware update.img

3.2 Sign externally

Sign every file with the private key and put the results back in wait_sign_dir under the original filenames. The PSS example is restored to one command line with unchanged arguments. For NOPADD, create a zero-filled 256-byte buffer, copy the SHA256 digest into its last 32 bytes, then run the second command. Match the algorithm to the chip table.

openssl pkeyutl -sign -in to_sign.bin -inkey privatekey.pem -out signed.bin -pkeyopt digest:sha256 -pkeyopt rsa_padding_mode:pss -pkeyopt rsa_pss_saltlen:-1

openssl rsautl -sign -in to_sign.bin -inkey privatekey.pem -raw -out signed.bin

3.3 Inject signatures

sign_tool ss --inject
sign_tool sf --firmware update.img

The tool reads signatures from the previously configured directory and injects them into the corresponding locations. Verify afterward with the matching v* command. No signing, OTP programming or device flashing was performed for this article.

Applicability and verification

This is a documentation-based workflow for the supplied tool collection. Confirm the exact board, SoC, carrier, SDK/BSP and host architecture before using it. No flashing, provisioning, register writes or hardware tests were performed. Package availability does not establish support for every ArmSoM product.

GitHub tool directory, versions and SHA-256

Open the matching GitHub directory, select the required host/version, then verify the file hash and extract the full directory. Links below open repository directories.

Open the tool directory on GitHub

Platform / version File SHA-256
Linux / 1.42 rk_sign_tool_v1.42_linux.zip 799a0fad6e363b141e244580479ed8434e05c070d924db8a289e277e50a7ca1d
Linux / directory snapshot rk_sign_tool-linux-directory-snapshot.zip db3cd185e5e38b886be0a162a92d3400368acfb5684744b8e91af5ef9cdeb06e
macOS / 1.2 sign_tool_v1.2_mac.zip 30ee08cb35681b735f1636bcc9215af64c4b6b5ca303a0889509be32209ea8ed

GitHub · catalog.json · SHA256SUMS

Source documents and figures

  • sign_tool用户使用手册.pdf

Find the correct ArmSoM board documentation

For board and carrier requirements, use the product manual first. The links below are platform references, not a statement that this archived tool has been validated on these products.

ArmSoM Docs · Sige7 / Docs · CM5 / Docs

Explore this topic → · Learning paths →