OpenPGP on File Upload Event Rule

For this example, we will create an Event Rule to trigger when a file is uploaded to the destination folder of the Folder Monitor Rule.

We want this Event Rule to decrypt the uploaded encrypted file, then:

  • If the Action failed to decrypt the file, then:

    1. Send email notification, and

    2. Write to Windows Event Log.

Prerequisites

  • Private OpenPGP key (part of original key pair)

  • Email address for notification

To create a File Upload Event Rule

  1. Create a new Rule.

  2. Select the File Uploaded event trigger and name the Rule.

  3. Add the File Name Condition to the Rule.

  4. Configure the File Name Condition to trigger only on files with the PGP extension.

  5. Add the Cryptography: OpenPGP Action.

  6. Set the OpenPGP action to Decrypt. (Only private keys added to the keyring will show in the list when choosing to decrypt.)

  7. Add the Protocol: Email Action under the if action failed Condition.

  8. Configure the email as desired.

  9. Add the Windows Event Log MadCap:keyword term="variables" /> Action, and specify which variables to write to the Event Log, such as the file name.

  10. Click Apply to save the Event Rule.