我正在使用PHP gnupg扩展名(https://www.php.net/manual/en/book.gnupg.php)加密一些字符串数据。加密部分工作正常,我得到了加密的字符串。但是,我想将GnuPG使用的压缩算法更改为“ ZIP”。有没有办法在PHP gnupg扩展中将压缩算法强制为“ ZIP”。
[加密后,我将加密的内容发送到API端点。 API供应商说我的压缩算法是“ ZLIB”,他们只接受“ ZIP”。我还找不到任何方法将算法更改为ZIP。请帮助
这是我正在使用的代码。
$gpg = new gnupg();
$gpg->seterrormode(gnupg::ERROR_EXCEPTION);
$info_pub = $gpg->import($publicKey);
$info_priv = $gpg->import($privateKey);
$gpg->addencryptkey($info_pub['fingerprint']);
$gpg->addsignkey($info_priv['fingerprint'], $passphrase);
$encrypted = $gpg->encryptsign($content);
return $encrypted;