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 = "18.104.22.168.22.214.171.124.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.