Skip to content

How to generate custom enc_key[] #1464

Answered by utzig
xianghui-renesas asked this question in Q&A
Discussion options

You must be logged in to vote

It however does not seem make sense, as the signing key size is 91 (root_pub_der[]), but the encryption key size is 70 (enc_key[]).

The reason for the size difference is that one is a public key and the other is a private key. Signature verification is done by using a public key, so that is what's stored in root_pub_der. To generate it, would require running:

$ imgtool keygen -k sig_key.pem -t ecdsa-p256
$ imgtool getpub -k sig_key.pem

This will get you the 91 byte array with the public key dump.

To create the private key dump for encryption you would do:

$ imgtool keygen -k enc_key.pem -t ecdsa-p256
$ imgtool getpriv --minimal -k enc_key.pem

This will get you the 70 bytes private key d…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@xianghui-renesas
Comment options

@utzig
Comment options

utzig Sep 4, 2022
Maintainer

Answer selected by xianghui-renesas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants