Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Managing MIME messages | Extracting Data from MIME and S/MIME Messages | Extracting the Payload from an Encrypted MIME Message | Example—Extracting Content from an Encrypted S/MIME Message
 
Example—Extracting Content from an Encrypted S/MIME Message
To run this example, you must provide the keystore alias and key alias for the recipient's private key. Some of these credentials are needed by the helper service, sample.smime.helpers:acquireEncryptedMsg, which generates the test message used in this example. You will need to edit the first step in the helper service to specify the location of these files on your system.
When you run this service from Designer, it will prompt you for the following:
Input Parameter
Description
recipientsKeystoreAlias
String Alias of the recipient’s keystore.
recipientsKeyAlias
String Alias of the private key in the recipient’s keystore.
Flow service that extracts the content from an encrypted MIME message
Step
Description
1
This step acquires an InputStream containing an encrypted multipart MIME message. This example uses a helper service to produce the test message. In a production solution, it is more likely that a MIME message would be passed into the pipeline by a content handler or a back-end system.
2
This step takes the InputStream from step 1 and decrypts the message. It produces a MIME object (mimeData) that contains the decrypted message’s constituent elements (header fields and content).
3
This step extracts each body part from mimeData and appends it to a String list.