Discuss this help topic in SecureBlackbox Forum

MIME: Encrypt and sign message using PGP/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 TElSimplePGPMIMEMessage class.

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

If you need to sign the messages using PGP/MIME, provide the keys, which will be used for signing. To do this set SigningKeys property of TElSimplePGPMIMEMessage class to reference the instance of TElPGPKeyring class, which contains the keys.

Note, that all keys will be used for signing, so if your keyring contains more keys, than you plan to use, then you need to copy the keys to other keyring. Remember, that when the data is signed, the private (secret, in PGP terms) keys are used, so you need to load the secret keyring to TElPGPKeyring.

The keys, used for signing, must contain the e-mail address, which corresponds to the address in From: property of the mail message.

When the keys are used, the password for the key might be needed. TElSimplePGPMIMEMessage asks the application for a password using OnKeyPassphrase event. You need to provide a handler for this event in order to supply TElSimplePGPMIMEMessage with a password.

Use PGPMIMEOptions property of TElSimplePGPMIMEMessage class to set the other encryption options. PGPMIMEOptions property references an instance of TElSimplePGPMIMEOptions class.

Set SignMessage property of TElSimplePGPMIMEOptions class to enable message signing.

If you need to encrypt the messages using PGP/MIME, provide the keys, which will be used for encryption. To do this set EncryptingKeys property of TElSimplePGPMIMEMessage class to reference the instance of TElPGPKeyring class, which contains the keys.

Set EncryptMessage property of TElSimplePGPMIMEOptions class to enable message encryption.

How To articles about simple MIME message creator

Discuss this help topic in SecureBlackbox Forum