Example: File Not Allowed to Persist Unencrypted on Disk
Example: File Not Allowed to Persist Unencrypted on Disk
You receive an encrypted file from an external source. The security policy prevents the file from being persisted on disk in decrypted, readable format.
A solution that calls a user access method program includes the following elements:
A data map with access method type USER specifies the file name, a decryption command such as "gpg -d %FILENAME%", and the file type of text or binary.
The pipe is created using API popen(), which executes the gpd command to decrypt the file and write the output to stdout.
The decrypted records in the pipe are read by using the APIs fgets() for a text file or fread() for a binary file.