Hello Umberto!
I wrote a patch to openssl, you can find it here
http://marc.info/?l=openssl-devm=138000831409222w=2
unfortunately nobody ever gave me an answer, neither positive nor negative,
and I pretty unhappy with that.
I'll probably release a software on my own based on that, even though
I am using openssl to sign files using a security token. The command that I
use is
OpenSSL smime -md sha256 -nodetach -binary -outform DER -sign -signer
my.pem -inkey id_ -keyform engine -in test.txt -out test.p7m
-engine pkcs11
and it works. The application that I use to verify the