问题标签 [gpgme]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
141 浏览

php - 在 PHP 中使用 gpupg_decrypt 永远不会完成

我正在使用 pecl 的 gnupg PHP 模块。具体来说: gpgme-devel 1.1.8 gnupg 模块 1.3.3

加密工作正常,而且速度很快。在命令行解密时使用 gpg 很快。当我尝试从 PHP 解密时,页面永远不会加载,甚至在调用解密之前的消息也不会打印。

日志中不会显示或显示任何错误。

编辑:因此,从命令行而不是通过 apache 运行相同的脚本会导致 gpg-agent 提示我输入密码短语,即使它是在库调用中提供的。

0 投票
0 回答
108 浏览

c++ - 在 C++ 中验证 RPM 签名?

我有一个 rpm 和可用于验证签名的公钥。我想在我的 C++ 程序中做某事之前验证该签名。我无法确定在这里使用的最佳库。

我的应用程序已经使用 OpenSSL 进行网络通信,所以如果我可以重用它会很棒。我也在看crypto++和GPGme。我只是想确保在开始解析 rpm 标头并重新发明轮子之前没有遗漏任何东西。

0 投票
1 回答
404 浏览

python - 如何在 python 中使用 gpgme 执行对称加密?

我正在尝试使用python对gpgme,pygpgme的包装器来实现对称加密。不幸的是,我使用的是 gpg 2.0.22 和 gpg-agent 2.0.22。这个邮件列表帖子说密码回调在 2.0 中被忽略,这是我遇到的问题。

当我运行以下代码时,我总是收到一条错误消息,提示“密码错误”,但我什至没有提示输入密码。理想情况下,尽管我希望能够代表用户提供密码:

passphrase_cb永远不会被调用。

如何提供密码以便执行对称加密?

0 投票
1 回答
616 浏览

pgp - What is the command line equivalent for "sign, armor and encrypt" using GPA - PGP?

I've been trying to figure out how to work the command lines for a GPA task that I want to automate. Currently, I just use GPA for Windows, select the key, select the file, check off "Armor", and click GO. There must be some command line interface for this. I'd like to work that into an automation program to eliminate the manual work.

Any ideas?

0 投票
1 回答
133 浏览

ruby - gpgme 的另一种对称算法

默认情况下,gpg2 使用 CAST5 进行对称加密。这里

r.read()将返回 CAST5 数据。

如何将默认密码算法更改为例如 AES256?

0 投票
1 回答
1642 浏览

php - PHP GnuPG - Signing message fails

Update

Apparently, even though I thought I was generating keys that did not have a password, gnupg still expected a password for them (which the gnupg extension no longer supports). I regenerated a new keypair using Kleopatra on Windows and bypassed all the "no passphrase" warnings and I was able to successfully sign/encrypt with those keys.

So, the bottom line is be very sure that your key does not have a passphrase.


I am attempting to sign a message using PHP's gnupg extension. I have the environment setup correctly, and I can successfully import the key, and adding it using gnupg_addsignkey is successful (returns true).

When I attempt to sign the message using gnupg_sign($res, "my message"), I get the following error and gnupg_sign returns false:

gnupg_sign(): data signing failed

I can't seem to find any way to get more verbose information to figure out why it's failing.

I've tried the procedural methods, as well as the OO methods, and get the same result. The permission are all correct on the server.

Here's the OO code I've used:

$signed is false, and I get the PHP warning gnupg::sign(): data signing failed

0 投票
1 回答
17939 浏览

linux - 无法在 linux 中生成 gpg 密钥

我无法在 linux 中生成 GPG 密钥

错误

请让我知道我在哪里做错了

0 投票
1 回答
1054 浏览

linux - 在 GPG 中解密时提供密码

当我手动使用 gpg 时,它工作正常。我在屏幕下方(“解锁密码”)我不想进入这个屏幕意味着我想自动化意味着我想在解密时提供密码。

0 投票
1 回答
492 浏览

c - C GPGMe 忽略用户密钥环

我最近完成了一个程序,它将公钥下载到内存中,然后用所有公钥创建一个加密消息。但是,我在创建仅包含我下载的密钥的列表时遇到了一些困难。首次下载时,它们存储在gpgme_data_t. 我找不到将其直接转换为gpgme_key_t. 因此,我只是将它们导入到新的上下文中。但是,当我再次导出密钥以便为 构建一个列表时gpgme_op_encrypt,我最终得到了本地密钥环中的其他密钥。我尝试了设置disable-gpgconf,但这并没有改变任何东西。我也尝试设置GNUPGHOME为 tmp 目录,但是当我调用 encrypt 时导致分段错误。有没有办法不导入用户的密钥环或将 a gpgme_data_tor转换char*为 a gpgme_key_t

0 投票
1 回答
1622 浏览

gnupg - gpgme:签名数据时选择私钥

使用 gpgme(gpg/gnupg 的开发库),我正在尝试签署一些数据。在密钥环中,我有超过 1 个私钥,所以我想选择正确的一个。这失败了:“无法使用的密钥(117440566)”。密钥是由 gnupg2 本身生成的。使用 gnupg 时也会出现问题。

首先,我检查是否有所选密钥的私钥:

签署:

现在 gpgme_op_encrypt_sign 总是因“无法使用的密钥(117440566)”错误而失败。任何提示/提示?

软件版本:

我启用了调试跟踪,但它对我没有多大帮助:

编辑

根据@kylehuff 的要求,这里是键选择的代码:

然后在构造函数中我做:

以及何时签署:

@kylehuff,这是你要求的吗?谢谢

编辑

这是 20CD3FF80DA6C1E46CD9F135CC73A8A60BF38589 的清单:

编辑

民谣@travelmate:~$ gpg2 --local-user 14B7E8E6 --sign bla.txt

folkert@travelmate:~$ gpg --verify bla.txt.gpg gpg: 签名于 2015 年 6 月 18 日星期四 07:18:17 PM UTC 使用 RSA 密钥 ID 74D6F5C6 gpg: 来自“testkey2 (testkey2)”的良好签名

并且使用编辑键我可以看到 74d6f5c6 确实是符号子键:

sub 1024R/74D6F5C6 创建时间:2015-05-31 过期:从不使用:S

所以我有点惊讶这对 gpgme 不起作用。不进行查找但直接 gpgme_get_key() 会给出相同的错误。