Gnupg files Permission correct? Error Message

时间:2018-02-03 11:08:14

标签: php encryption laravel-5 gnupg

Are my ./gnupg files permission correct on Debian?

drwx------  2 user user 4096 Feb  2 09:38 .
drwxr-xr-x 24 root root 4096 Feb  2 09:39 ..
-rw-------  1 user user 9188 Feb  1 11:03 gpg.conf
-rw-------  1 user user  680 Feb  1 11:04 pubring.gpg
-rw-------  1 user user  680 Feb  1 11:04 pubring.gpg~
-rw-------  1 user user  600 Feb  1 11:04 random_seed
-rw-------  1 user user 1420 Feb  1 11:04 secring.gpg
-rw-------  1 user user 1280 Feb  1 11:04 trustdb.gpg

My Script echo following error with echo $gpg->geterror();:

putenv("GNUPGHOME =/home/user/.gnupg");
$gpg = new gnupg();
$key = $gpg->import($user_details->pgp);
$gpg->addencryptkey($key['fingerprint']);
$enc = $gpg->encrypt($secret);
$gpg->clearencryptkeys();
echo $gpg->geterror();

Error: no key for encrypten set

Thanks

0 个答案:

没有答案