I am now trying to write a small web application in PHP for my personal use.
It reads a file encrypted with my GnuPG public key, decrypts it, and shows the content in pretty HTML format.
Because PHP natively supports many GnuPG wrapper functions, I only wrote codes to call those wrapper functions. By the GnuPG's nature, you have to provide the pass phrase before decrypting the file to retrieve the secret key .
I configured up my application running with my user ID under user-dir directory, i.e. ~/public_html, within apache 2.4 prefork process. This setting requires Apache 2 PHP module as well as mod_ruid2, which enables apache handlers to run under the user-dir.
When I ran my PHP application supplying my key ID and its pass phrase as the form input elements on my desktop browser, an unusual pop-up window came up. It is not the browser's one, but the keyring manager's window on my desktop environment. It surprised me because normal web applications don't do such thing and no such behavior is written in the PHP document. But I understand shortly that the GnuPG's key agent (gpg-agent) must have launched the pop-up window asking for the pass phrase.
This is against my expectation, but is not critical. But I still want to know how to disable the intervention of the gpg-agent by control from within the PHP code.
It reads a file encrypted with my GnuPG public key, decrypts it, and shows the content in pretty HTML format.
Because PHP natively supports many GnuPG wrapper functions, I only wrote codes to call those wrapper functions. By the GnuPG's nature, you have to provide the pass phrase before decrypting the file to retrieve the secret key .
I configured up my application running with my user ID under user-dir directory, i.e. ~/public_html, within apache 2.4 prefork process. This setting requires Apache 2 PHP module as well as mod_ruid2, which enables apache handlers to run under the user-dir.
When I ran my PHP application supplying my key ID and its pass phrase as the form input elements on my desktop browser, an unusual pop-up window came up. It is not the browser's one, but the keyring manager's window on my desktop environment. It surprised me because normal web applications don't do such thing and no such behavior is written in the PHP document. But I understand shortly that the GnuPG's key agent (gpg-agent) must have launched the pop-up window asking for the pass phrase.
This is against my expectation, but is not critical. But I still want to know how to disable the intervention of the gpg-agent by control from within the PHP code.
Comments
Post a Comment