GnuPG PHP gnupg Folder & Files Permission

Posted by Michael Robinson on Super User See other posts from Super User or by Michael Robinson
Published on 2011-06-23T23:44:48Z Indexed on 2011/06/24 0:25 UTC
Read the original article Hit count: 649

Filed under:
|
|
|

Situation: we plan on using PHP's GnuPG extension to encrypt/decrypt files.

Currently we've setup some test cases, using keys generated with GPG.

The generated files reside in:

/Users/username/.gnupg/

I am able to get keyinfo for the key I want to use to encrypt/decrypt, but when I attempt to use addencryptkey, I get:

(E_WARNING: 2): gnupg::addencryptkey() [gnupg.addencryptkey]: get_key failed

I think this is due to the permissions on the ~/.gnupg folder & enclosed files.

The files are owned by me - username, but apache runs as www.

A few days ago I did have this working, but it seems each time I use GPG Keychain Access to import / export a key, the folder's permissions are changed.

Question: What are the exact permissions required to allow PHP's GnuPG to add encrypt & decrypt keys?

© Super User or respective owner

Related posts about php

Related posts about apache