workmad3 is apparently out of date, at least for current gpg, as the --allow-secret-key-import is now obsolete and does nothing.
What happened to me was that I failed to export properly. Just doing gpg --export is not adequate, as it only exports the public keys. When exporting keys, you have to do
One more cause for the "secret key not available" message: GPG version mismatch.
Practical example: I had been using GPG v1.4. Switching packaging systems, the MacPorts supplied gpg was removed, and revealed another gpg binary in the path, this one version 2.0. For decryption, it was unable to locate the secret key and gave this very error. For encryption, it complained about an unusable public key. However, gpg -k and -K both listed valid keys, which was the cause of major confusion.
The resolution to this problem for me, was to notify the sender that he did use the Public key that I sent them but rather someone elses. You should see the key that they used. Tell them to use the correct one.
发布评论
评论(6)
是的,您的密钥似乎丢失了。 没有它,您将无法解密文件。
你有把钥匙备份在某处吗?
无论您是否使用相同的密码,重新创建密钥都不起作用。 每个密钥对都是唯一的。
Yes, your secret key appears to be missing. Without it, you will not be able to decrypt the files.
Do you have the key backed up somewhere?
Re-creating the keys, whether you use the same passphrase or not, will not work. Each key pair is unique.
workmad3 显然已经过时了,至少对于当前的 gpg 来说是这样,因为
--allow-secret-key-import
现在已经过时并且什么也不做。我遇到的问题是我未能正确导出。 仅仅执行 gpg --export 是不够的,因为它只导出公钥。 导出密钥时,您必须执行以下操作
workmad3 is apparently out of date, at least for current gpg, as the
--allow-secret-key-import
is now obsolete and does nothing.What happened to me was that I failed to export properly. Just doing
gpg --export
is not adequate, as it only exports the public keys. When exporting keys, you have to do导致“密钥不可用”消息的另一个原因是:GPG 版本不匹配。
实际例子:我一直在使用GPG v1.4。 切换包装系统后,MacPorts 提供的 gpg 被删除,并在路径中显示了另一个 gpg 二进制文件,即版本 2.0。 对于解密,它无法找到密钥并给出了这个错误。
对于加密,它抱怨公钥无法使用。
然而,gpg -k 和 -K 都列出了有效的密钥,这是造成重大混乱的原因。
One more cause for the "secret key not available" message: GPG version mismatch.
Practical example: I had been using GPG v1.4. Switching packaging systems, the MacPorts supplied gpg was removed, and revealed another gpg binary in the path, this one version 2.0. For decryption, it was unable to locate the secret key and gave this very error.
For encryption, it complained about an unusable public key.
However, gpg -k and -K both listed valid keys, which was the cause of major confusion.
对我来说,解决这个问题的方法是通知发件人他确实使用了我发送给他们的公钥,而不是其他人的公钥。 您应该看到他们使用的密钥。 告诉他们使用正确的方法。
The resolution to this problem for me, was to notify the sender that he did use the Public key that I sent them but rather someone elses. You should see the key that they used. Tell them to use the correct one.
您不仅需要导入您的密钥,还需要导入相应的公钥,否则您将收到此错误。
You need to import not only your secret key, but also the corresponding public key, or you'll get this error.
从旧密钥环重新导入密钥时,您需要指定命令:
否则只会导入公钥,而不导入私钥。
when reimporting your keys from the old keyring, you need to specify the command:
otherwise it will only import the public keys, not the private keys.