How to sign kernel image using private key

Hello Everyone,

I have encrypted U-Boot (AES-256) with fuses burned. My U-boot comes up fine but it is unable to load the kernel because the image format is not recognized.

kernel image resides in NAND flash. I have tried encrypting the kernel image with AES 256 and a private key. But the decryption of the image is not correct when I debug on the board. The error I get is “Wrong Image format” when I ran bootm command.

I’m suspecting the process of generating the kernel signed image is not correct.

I really appreciate if someone can help me in signing the kernel image using the key that I burn fuses.

Thank you,