My task is to insert a .der file into my STM32 firmware via makefile. I manage to do this using the following code:
ifndef PRVTK_DER
PRVTK_DER = $(shell xxd -p PrivateKey.der | tr -d '\n')
endif
-DPK_STRING='"$(PRVTK_DER)"' \
This way, i get in my code the hexadecimal encoded string (like "010203040506.."). Then i just decoded into hexadecimals and voi'la.
Although what i actually need is to avoid this decoding process. If i could manage to just have in my code the hexadecimal corresponding to the .der file instead of a string, it would be perfect. Just like makefile created something similar like this:
#define DER_KEY {0x01, 0x02, 0x03, 0x04, 0x05 ......... }
And i could access it referencing "DER_KEY".
I was able to insert hexadecimal numbers via makefile, but when hex size is bigger than 8,my code crashs, probably because in my attempts the variables was been construct like 0x0102030405... instead of an array.
Well, any ideas?