Surely, it could be done signing inside Yocto. Just make some bb files.
But it makes no sense.
Surely, a very basic violation of security basic concept.
It should have a security server to sign for you. not you do it by yourself.
The security server is black box to you. You will never know the private key.
Your input is an Images and security server output is a signed image and public key.
Of course, for i.MX could be csf bin, key hash.
