MailMessage.AttachSignature
Contents
[
Hide
]AttachSignature(X509Certificate2, bool)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
public virtual MailMessage AttachSignature(X509Certificate2 certificate, bool detached)
Parameter | Type | Description |
---|---|---|
certificate | X509Certificate2 | X.509 certificate. |
detached | Boolean | .If detached is true, the signature is detached.If detached is false(the default), the signature is not detached. |
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
AttachSignature(CmsSigner, bool)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
public virtual MailMessage AttachSignature(CmsSigner signer, bool detached)
Parameter | Type | Description |
---|---|---|
signer | CmsSigner | System.Security.Cryptography.Pkcs.CmsSigner. |
detached | Boolean | .If detached is true, the signature is detached.If detached is false(the default), the signature is not detached. |
Return Value
The signed MailMessage.
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
AttachSignature(X509Certificate2)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
public virtual MailMessage AttachSignature(X509Certificate2 certificate)
Parameter | Type | Description |
---|---|---|
certificate | X509Certificate2 | X.509 certificate. |
Return Value
The signed MailMessage.
Examples
The following example shows how to attach a Certificate with AttachSignature Method.
[C#]
var privateCertFile = "MartinCertificate.pfx";
var privateCert = new X509Certificate2(privateCertFile, "anothertestaccount");
var msg = new MailMessage("user@domain.com", "receiver@domain.com", "subject:Signed message only by AE", "body:Test Body of signed message by AE");
var signed = msg.AttachSignature(privateCert, true);
[Visual Basic]
Dim privateCertFile = "MartinCertificate.pfx"
Dim privateCert = New X509Certificate2(privateCertFile, "anothertestaccount")
Dim msg = New MailMessage("user@domain.com", "receiver@domain.com", "subject:Signed message only by AE", "body:Test Body of signed message by AE")
Dim signed = msg.AttachSignature(privateCert, True)
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
AttachSignature(CmsSigner)
Creates a signed message. Creates a read-only copy of the specified MailMessage and adds a digital signature to it.
public virtual MailMessage AttachSignature(CmsSigner signer)
Parameter | Type | Description |
---|---|---|
signer | CmsSigner | System.Security.Cryptography.Pkcs.CmsSigner. |
Return Value
The signed MailMessage.
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email