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
 
Extracting the Payload from an Encrypted MIME Message
 
How Do You Know Whether the Message Is Encrypted?
How to Extract the Payload from an Encrypted S/MIME Message
Example—Extracting Content from an Encrypted S/MIME Message
When you pass an encrypted S/MIME message to the createMimeData service, it returns an empty MIME object, because it cannot parse encrypted messages. To extract data from an encrypted message, you must decrypt the message with pub.smime.keystore:processEncryptedData. This service reads an InputStream that contains an encrypted message, decrypts it using a private key pointed by the keystore alias and key alias that you supply, and returns a MIME object containing the message’s constituent elements.
Important:
This procedure is applicable only to InputStream objects and not to MimeMessage objects.