I've a certificate and wanted to use it to encrypt the MailMessage for creating a smime message.
Certificate recipient = Certificate.LoadPfx(certificateKey, certificatePassword);
var message = new MailMessage();
string enhancedUsageOids = recipient.GetEnhancedUsage();
However, the enhancedUsageOids = "126.96.36.199.188.8.131.52.1" and so when I use message.Encrypt I got the same error "No recipient has a certificate with correct key usage for encryption".
I can create a smime message with EnvelopedCms (.net framework), encrypted using upper certificate.
My question is can I archived the same thing with Rebex ? Cause when using EnvelopedCMS to generate the smime message, I have to use Reflection for getting the message.