Official PHP gnupg extension repository
Find a file
Jakub Zelenka 34e4c9542b
Fix #32: Decryption of message encrypted with multiple keys
When the message is encrypted with multiple keys and the decryption
key(s) added is not the first encrypted key, then it was failing due to
invalid early failure when uid was not found in decrypted keys. This
changes such behavior and just returns empty key instead in such case.
2025-05-05 19:43:45 +02:00
.github/workflows Remove ubuntu-20.04 from CI 2025-04-22 15:31:55 +02:00
phpc@40078fd256 Fix GH-37: decryption of an encrypted empty string returns false (#50) 2025-03-18 14:54:49 +01:00
tests Fix #32: Decryption of message encrypted with multiple keys 2025-05-05 19:43:45 +02:00
.gitignore Ignore config.cache 2025-03-18 17:37:06 +01:00
.gitmodules Make initial port to phpc 2016-05-21 21:27:06 +01:00
config.m4 Add /opt/homebrew to the configuration SEARCH_PATH (#43) 2022-02-20 21:06:23 +00:00
EXPERIMENTAL initial release 2005-10-07 18:59:50 +00:00
gnupg.c Fix #32: Decryption of message encrypted with multiple keys 2025-05-05 19:43:45 +02:00
gnupg_keylistiterator.c Fix iterator prototypes for PHP 8.1 (#35) 2021-09-19 20:01:29 +01:00
LICENSE Update LICENSE file 2016-07-24 19:01:52 +01:00
NEWS.md Release 1.5.2 2025-04-08 12:29:42 +02:00
package.xml Fix package.xml formatting and add missing no_uid_hint_msg.gpg 2025-04-08 14:03:57 +02:00
php_gnupg.h Release 1.5.2 2025-04-08 12:29:42 +02:00
php_gnupg_keylistiterator.h Port gnupg_keylistiterator to use phpc 2016-05-22 18:52:23 +01:00
README.md Create a new README and some minor info updates 2021-04-10 19:42:28 +01:00
UPGRADING.md Create a new README and some minor info updates 2021-04-10 19:42:28 +01:00

PHP GnuPG

The php-gnupg is a wrapper for GpgME library that provides access to GnuPG.

Installation

Linux

Before starting with installation of this extensions, the GpgME library has to be installed. It has got installation packages on the most Linux distributions. The minimal version of GpgME that is supported is 1.3.0. The extension supports GnuPG version 1 and 2.

Of course PHP has to be installed too. The minimal version that is supported is 5.3.2.

PECL

This extension is available on PECL.

$ sudo pecl install gnupg

Manual Installation

It's important to have a git installed as it's necessary for recursive fetch of phpc.

First clone recursively the repository

git clone --recursive https://github.com/php-gnupg/php-gnupg.git

Then go to the created directory and compile the extension. The PHP development package has to be installed (command phpize must be available).

cd php-gnupg
phpize
./configure
make
sudo make install

Finally the following line needs to be added to php.ini

extension=gnupg.so

or for PHP 8+ it's just

extension=gnupg

Windows

The extension is not currently supported on Windows due to unavailable GpgME library builds that would be supported by PHP.

Documentation

The extension documentation is now available in the PHP-Manual: http://php.net/manual/en/book.gnupg.php