If you’ve encrypted PDF files using AES-256 outside of PeopleSoft (e.g., via OpenSSL), and now need to decrypt and view them inside PeopleSoft—this PeopleCode-based solution lets you do that securely and efficiently.
This is especially useful when you want to keep files encrypted at rest but still allow authorized users to view them through the PeopleSoft UI, without manual decryption.
Encryption Setup Outside PeopleSoft
You encrypt the PDF like this using OpenSSL:
To decrypt it manually for testing:
This assumes:
-
AES-256 in ECB mode
-
No salt
-
PKCS5 padding
-
A 32-byte key represented as 64 hex characters
The PeopleCode Solution
Here’s the full PeopleCode to decrypt the file, display it using ViewAttachment()
, and then clean it up:
Key Considerations
-
The key must be exactly 32 characters long for AES-256.
-
The encryption must match the decryption logic: ECB mode, no salt, and PKCS5 padding.
-
This script decrypts the file to
/tmp
, shows it usingViewAttachment()
, and then deletes the decrypted file to maintain security.
No comments:
Post a Comment