请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC3235SF 主题中讨论的其他器件:CC3220SF、
你好!
我想在对闪存进行编程时使用加密私钥。 由于我无法使用 SLImageCreator 工具找到输入/读取密码的方法、因此我单独制作了签名、并 在加载 MCU 时将签名作为输入。
#Get the MCU signature openssl dgst -sha256 -binary -sign "$SSKey" -passin pass:$Password \ -out "mcu.signed.bin" "mcu.bin" #Add the MCU project add_file --name "$ProjName" --overwrite --file "$Dir/mcu.bin" --mcu --flags secure,publicwrite \ --sign "$Dir/mcu.signed.bin" --cert "$SSCert" #Program the Device "$ImageCreatorPath/SLImageCreator.exe" \ project program --name "$ProjName" --dev
但是、这会产生错误:"sl_wrong_signatic"。 我目前正在使用虚拟证书目录、当私钥未加密时、它工作正常。
我已经尝试添加"-c"、将"SHA256"替换为"SHA1"(即使这不起作用)、将"二进制"替换为"十六进制"、并将密钥转换为"openssl pkcs8 -topk8"(在 DER 中加密密钥的唯一方法)。 所有这些测试似乎都进一步中断了。
我在另一篇文章(针对 CC3220SF)中读到、自 SLImageCreator 自动生成的签名是使用以下命令创建的:
OpenSSL> dgst -binary -sha1 -sign <file-location>\<private_key>.pem \ -out <file-location>\<output>.sig <file-location>\<input>.txt
从 Toby Pan。 但我想对于 CC3235SF、它应该是"SHA256"。
我想知道我是否正确理解了这一点、是否缺少了什么、以及为什么它不起作用。
提前非常感谢!
此致、
David