PGPCOMMAND        Send a “raw” GnuPG command

Top  Previous  Next

Syntax:

PGPCOMMAND

[ command ] [ log file ]

Arguments:

[ command ]

A variable  or string defining the command to pass to the GnuPG executable “gpg.exe”

 

[ log file ]

A variable or string defining the log file where commands and responses from GnuPG (gpg.exe) are recorded when the specified command is executed. This log file may be used for troubleshooting; it may also be parsed by other script commands (e.g., READFILE) to identify GnuPG results not directly supported by FileLink.

 

 

NOTE: THIS COMMAND IS PROVIDED FOR CONVENIENCE TO EXPERIENCED GNUPG USERS ONLY. WE DO NOT OFFER SUPPORT FOR GNUPG COMMANDS BEYOND WHAT FILELINK DIRECTLY PROVIDES VIA THE PGPDECRYPT AND PGPENCRYPT SCRIPT COMMANDS. USE THE PGPCOMMAND AT YOUR OWN RISK.

 

This script command allows "raw" GnuPG commands to be passed to "gpg.exe" (the PGP component of FileLink) that are not directly supported by FileLink.

 

For example, to list the keys on your keyring, the command would be:

 

PGPCOMMAND "--list-keys" "gnupg.log"

 

To list the fingerprints, the command would be:

 

PGPCOMMAND "--fingerprint" "gnupg.log"

 

Be sure to always precede each GnuPG option with two dashes.

 

The results from PGPCOMMAND are written to the specified log file which is created in the FileLink working folder (unless a fully qualified file name is provided). If you want to have access to this information within your script, write script code using the READFILE script command to parse this file.

 

For example, here is the sample output to the log file using “--fingerprint” :

 

040421124415076 :: ******* : END OF COMMAND

040421124508516 :: ******* : START DirectCommand

040421124508516 :: ******* : START INPUT

040421124508516 :: in : "C:\PROGRA~1\ROBO-F~1.0BE\gpg" --fingerprint > "C:\PROGRA~1\ROBO-F~1.0BE\Logs\command.log"

040421124508516 :: ******* : END OF INPUT

040421124508576 :: ******* : Results of evaluation = 0

040421124508576 :: ******* : Results

040421124508576 :: out : c:/gnupg\pubring.gpg

--------------------

pub  1024D/5F9786A6 2003-05-01 Juan Valdez <[email protected]>

   Key fingerprint = 2B96 4426 8FC0 8FFA D6A9  0412 91D3 8355 5F97 86A6

sub  2048g/5416ED79 2003-05-01

 

Using the READFILE command you can read the “gnupg.log” file down to the line containing the fingerprint, use the SETRIGHT command to extract the fingerprint into a script variable if need be.

 

Related Command(s): PGPDECRYPT, PGPENCRYPT, PGPIMPORT