Discuss this help topic in SecureBlackbox Forum

MIME: Encrypt and sign message using S/MIME

If you need to create a signed or encrypted message, instead of creating an instance of TElSimpleMIMEMessage you need to create an instance of TElSimpleSMIMEMessage.

Follow the instructions in the corresponding how-to article to setup the message.

If you need to sign the message, you need to provide certificates, used for signing. This is done by assigning a certificate storage to SignCertStorage property of TElSimpleSMIMEMessage class. At least one of certificates in the certificate storage must include the private key. This certificate must also be issued for e-mail signing and contain the e-mail address, which corresponds to the address in From: property of the mail message.

Use SMIMEOptions property of TElSimpleSMIMEMessage class to set the other signing options. SMIMEOptions property references an instance of TElSimpleSMIMEOptions class.

Set SignMessage property of TElSimpleSMIMEOptions class to enable message signing. You can set the time of signing using SignTime property of TElSimpleSMIMEOptions class.

When you sign the data, it can be necessary to provide complete certificate chain. To do this, set IncludeIssuerCertificates property of TElSimpleSMIMEOptions class to true.

To encrypt the data using S/MIME, you need to provide certificates, used for encryption. This is done by assigning a certificate storage to EncryptCertStorage property of TElSimpleSMIMEMessage class. Use SMIMEOptions property of TElSimpleSMIMEMessage class to set the other encryption options. SMIMEOptions property references an instance of TElSimpleSMIMEOptions class.

Set EncryptMessage property of TElSimpleSMIMEOptions class to enable message encryption. You can set encryption algorithm using EncryptAlgorithm property of TElSimpleSMIMEOptions class. If the algorithm can operate with different key lengths (for example, AES can work with 128-bit, 192-bit and 256-bit keys), set EncryptBitsInKey property of TElSimpleSMIMEOptions class to desired key length.

How To articles about simple MIME message creator

Discuss this help topic in SecureBlackbox Forum