That works as expected thank you! I really appreciate you taking the time to send the updated code. If I ever get another spendable merit I'll send it your way. ;0)
That's OK, I learnt stuff too

I used to know that it was possible to create a bitcoin key with openssl ecparam/ec and extract it from DER, but I didn't know that it was possible to rebuild a DER file from a key. I learnt that too today, and I'm pretty happy about it.
Have a nice day!