OK I understand better. I tried to adapt your code from your blog post but am stuck at the initialize method of the ISignerCertificate COM object.
My signing certificate has its private key on a smart card and uses a 3rd party CSP. Even if I change the value of the second argument of the initialize method (I tried all values up till 4) and set the silent (=false) and even PIN properties before invoking Initialize, I get the following error message:
Do you know how I can construct my ISignerCertificate object properly?
Or adapt my .NET code from above so that it replicates the behaviour of IX509CertificateRequestPkcs7.InitializeFromInnerRequest (when giving a PKCS#10)?
Thank you again,
My signing certificate has its private key on a smart card and uses a 3rd party CSP. Even if I change the value of the second argument of the initialize method (I tried all values up till 4) and set the silent (=false) and even PIN properties before invoking Initialize, I get the following error message:
CertEnroll::CSignerCertificate::Initialize: Key does not exist. 0x8009000d (-2146893811 NTE_NO_KEY)
Using other tools to sign data (the SignedCms .NET class for instance) it works without any problem (prompt me for PIN then sign).Do you know how I can construct my ISignerCertificate object properly?
Or adapt my .NET code from above so that it replicates the behaviour of IX509CertificateRequestPkcs7.InitializeFromInnerRequest (when giving a PKCS#10)?
Thank you again,