在我的桌面 Debian GNU/Linux 9.11 (stretch) 上,代码有效,但在服务器 Ubuntu 16.04.6 上无效
问题出现在方法 Function: gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) https://www.gnupg.org/documentation/manuals/gpgme/Decrypt.html
crypto = GPGME::Ctx.new(
pinentry_mode: GPGME::PINENTRY_MODE_LOOPBACK,
passphrase_callback: method(:passfunc)
)
data = crypto.decrypt(encrypted_data)
引发异常 GPGME::Error 并显示消息“不支持”
错误发生在 GEM shared/bundle/ruby/2.5.0/gems/gpgme-2.0.18/lib/gpgme/ctx.rb:428:in `decrypt'
def decrypt(cipher, plain = Data.new)
err = GPGME::gpgme_op_decrypt(self, cipher, plain)
https://www.rubydoc.info/gems/gpgme/2.0.18/GPGME/Error中未记录带有消息“不支持”的异常 GPGME::Error
在我的开发 PC 上,没有引发异常!