如何使用 Crypt GPG 以编程方式禁用 MDC 保护

问题描述

最近,我的代码无法解密某个文件

public function decryptFile($inputFile,$outputFile)
{
    $privateKey = 
    $password = 

    $keyInfo = $this->gpg->importKey(file_get_contents($privateKey));

    $this->gpg->addDecryptKey($keyInfo['fingerprint'],$password);
    $decryptedFileTmp = stream_get_Meta_data(tmpfile())['uri'];

    $this->gpg->decryptFile($inputFile,$decryptedFileTmp);

    // Replace the original with decrypted one
    copy($decryptedFileTmp,$outputFile);
}

当我通过 kleopatra 手动解密时,它告诉我使用 --ignore-mdc-error

有没有办法使用 Pear 的 Crypt_GPG 库以编程方式执行此操作?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)