Hi,
I'm trying to sign a MailMessage using the following code:
Dim Store As New Rebex.Security.Certificates.CertificateStore(CertificateStoreName.My)
Dim options As CertificateFindOptions = CertificateFindOptions.HasPrivateKey Or CertificateFindOptions.IsTimeValid
Dim Certificado() As Certificate = Store.FindCertificatesForMailAddress(RemetenteMailbox, options)
If Certificado.Length > 0 Then
Dim Signer As Certificate = Certificado(0)
Dim parameters As New MailSignatureParameters()
With parameters
.Silent = False
End With
My_MIME_msg.Sign(parameters, Signer)
End If
The Certificate is correctly found in Store and I have my USB TOKEN attached.
When I call the SIGN function, the program raises the following error: UNABLE TO SIGN HASH
Interesting that the USB TOKEN is not called anyway.
I ran another program I made using BouncyCastle and Mimekit and everything goes ok: the TOKEN is called, it asks me the password, and so forth.
Do you know what am I doing wrong here?
I appreciate any help.