I am sorry for not understanding the document. S/MIME encryption is used in the email attachment, and "smime-type" parameter set to "signed-data", how should I save the attachment after decryption? The following code is used.
var message = await inbox.GetMessageAsync(uniqueId);
var entity = Decrypt(message);
var attachments = new List();
var multiparts = new List();
using (var iter = new MimeIterator(message))
{
// collect our list of attachments and their parent multiparts
while (iter.MoveNext())
{
var multipart = iter.Parent as Multipart;
var part = iter.Current as MimePart;
if (multipart != null && part != null && part.IsAttachment)
{
// keep track of each attachment's parent multipart
multiparts.Add(multipart);
attachments.Add(part);
}
}
}
for (int i = 0; i < attachments.Count; i++)
multiparts[i].Remove(attachments[i]);
How do I decrypt and save attachments in multiparts
I am sorry for not understanding the document. S/MIME encryption is used in the email attachment, and "smime-type" parameter set to "signed-data", how should I save the attachment after decryption? The following code is used.
var message = await inbox.GetMessageAsync(uniqueId); var entity = Decrypt(message); var attachments = new List();
var multiparts = new List();
using (var iter = new MimeIterator(message))
{
// collect our list of attachments and their parent multiparts
while (iter.MoveNext())
{
var multipart = iter.Parent as Multipart;
var part = iter.Current as MimePart;
} for (int i = 0; i < attachments.Count; i++) multiparts[i].Remove(attachments[i]);
How do I decrypt and save attachments in multiparts