Hello,
Like similar save options in Words do you have save options to Sign only (NO encrypt) emails on save?
We have certificate with private key in a X509Certificate2.
Needed for Eml/Emlx and Msg/Oft/Tnef to sign on save.
Thanks for advise
Hello,
Like similar save options in Words do you have save options to Sign only (NO encrypt) emails on save?
We have certificate with private key in a X509Certificate2.
Needed for Eml/Emlx and Msg/Oft/Tnef to sign on save.
Thanks for advise
Hello, you can use the AttachSignature(X509Certificate2) method of MailMessage and then call the Save method.
Hello and thanks, what’s the difference between this and MailMessage.Sign?
Also AttachSignature will work for MapiMessage?
Best
MailMessage.Sign, I’m not sure I know about this. Anyway, we’ll see on Monday.
Sorry, my confusion, just one thing, there’s no MapiMessage.AttachSignature counterpart
Hopefully there is a way to sign a MapiMessage using X509Certificate2 pfx?
Thanks
Hi @australian.dev.nerds
You can sign MapiMessage if you convert it to MailMessage. Then you can save it in eml format or msg format.
So we cannot sign MapiMessage, since converting it to MailMessage will remove many Mapi properties.
May I ask a feature request ticket for adding MapiMessage.AttachSignature?
We will discuss this request with our project manager and inform you through this thread.
Thank you very much, highly appreciated
Btw, if there’s a way to select between sha256, sha384 and sha512 when s/mime signing of emails, please kindly advise?
You can use public virtual MailMessage AttachSignature(CmsSigner signer) method with
previously created a CmsSigner with the necessary parameters like this:
MailMessage msg = MailMessage.Load("d:\msg.eml");
X509Certificate2 certificate = new X509Certificate2("d:\cert.pfx", "password");
CmsSigner signer = new CmsSigner(certificate);
signer.DigestAlgorithm = new Oid("SHA256");//you can use SHA1,SHA256,SHA512
MailMessage signedMsg = msg.AttachSignature(signer);
Hello and thanks, a strange thing:
The project is fine in vs.net 2010 but won’t compile in .net 2022:
The error is only for MailMessage.AttachSignature
Error BC30652 Reference required to assembly System.Security Version=4.0.0.0 containing the type CmsSigner. Add one to your project.
System.Security is already imported.
Should use:
Reference Include=“System.Security”
instead of:
Import Include=“System.Security”
@australian.dev.nerds
Some questions:
1.How you use Aspose.Email dll - from file or NuGet?
2.Which version of framework you use in vs 2022?
@australian.dev.nerds
Please try the following steps:
1.Create a new project from scratch.
2.Add a reference to Aspose.Email from Nuget.
3.Implement the code.
4.Try to compile.
If all else fails, archive the project and send it to us.
Hello there
Can you please be so kind and pull the info if the feature is approved and about its priority?
IMO I think it’s a must have to be able to sign messages for email components, as agreed, converting to/from MailMessage is useless as will remove all the MAPI properties so is destructive.
Thank you
Hello,
We will inform you about it within 2-3 days.
@australian.dev.nerds
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): EMAILNET-41221
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thanks a thousand times, awesome feature to have
You are welcome.
Hello,
Is this already added?