Skip to main content
Skip table of contents

Examples

File Encryption

To encrypt a file /tmp/TEST1.TXT with the key identified in the previos chapter, use this command. The system will create a file /tmp/TEST1.TXT.GPG.

Replace 8392E404 with your key in parameter PUBLICKEY()

CODE
STRPGP FRMPATH('/tmp')      
       FRMIFSFILE(TEST1.TXT)
       TOPATH('/tmp')       
       ACTION(*SIGNENCRYPT) 
       PUBLICKEY(8392E404)  

File Decryption 

To decrypt the file encrypted in the previous step, use this command

Replace 8392E404 with your key in parameter PUBLICKEY()

Replace ieffect with the passphrase you defined when creating the keypair in Kleopatra.

CODE
STRPGP FRMPATH('/tmp')            
       FRMIFSFILE(TEST1.TXT.GPG)
       TOPATH('/tmp')             
       ACTION(*DECRYPTVERIFY)     
       PUBLICKEY(8392E404)        
       DECRPASS('ieffect')

 

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.