We are building a Digitial Signing platform. Per user we generate a RSA 2048 key pair in an HSM, and issue a X509 digital certificate. During PAdEs or CAdES digital signing (Enveloping) we get the SHa256 hash 32 bytes that needs to be encrypted with user's RSA private key in order to complete signing operation.
What PKCS11 mechanism and function should we use to encrypt a hash with RSA private key?
It seems using CKM_SHA256_RSA_PKCS with C_Sign() will hash the hash and then sign/encrypt it. which is not what we want - unless i am mistaken.
Would this work: C_Encrypt(CKM_RSA_PKCS, privateKeyHandle, hashBytes)? according to documentation CKM_RSA_PKCS uses public key.
Many Thanks