I have a python program which uses PyKCS11, a python wrapper for pkcs11 interface. I can sign data with a ECC private key (Mechanism CKM_ECDSA) that is stored on a HSM and that is accessed by PyKCS11.
What I now want is to verify with openssl the ECDSA signature by the corresponding public key. This public key is contained in a x509 (NewCert.pem) which was created out of the private key in the HSM.
I tested many ways to verify the signature properly, but I didn't succeed.
openssl dgst -ecdsa-with-SHA1 -verify <(openssl x509 -noout -pubkey -in NewCert.pem) -signature <(cat sign | base64 -d) file
The file 'signature' contains the base64 encoded signature. And the file 'file' the plain data.
Thank you