views:

99

answers:

2

I need to append my public key (which is in a variable) in pubring of .gnupg using the system call in PHP. What system call is available for this?

$gpg = system('gpg --recipient userid --output outfile.asc --armor  --encrypt hello.txt', $retvalue);//calling gpg encrypt command using system call
echo '
Output: ' . $gpg . '
Return value: ' . $retvalue;

How can I pass my public key to this GPG encryption command?

+1  A: 

Check out PHP manual about the system calls here http://php.net/manual/en/function.system.php also look into exec() http://www.php.net/manual/en/function.exec.php if you want to open some external program to manage your requests.

vaske
A: 

Also check out the backtick operator.

Felix