You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the error message looks interesting, I don't get what you want to achieve. In public key cryptography, you can't decrypt message with a public key.
I have an encrypted file with pgp extension that needs to be decrypted using the shared public key.
`require 'rubygems'
require 'gpgme'
def passfunc(obj, uid_hint, passphrase_info, prev_was_bad, fd)
io = IO.for_fd(fd, 'w')
io.puts "PASSPHRASE"
io.flush
end
encrypted_data = GPGME::Data.new(File.open("file.xls.pgp"))
key = GPGME::Data.new(File.open("key.txt"))
ctx = GPGME::Ctx.new :passphrase_callback => method(:passfunc)
ctx.import_keys key
decrypted = ctx.decrypt encrypted_data
puts decrypted.read`
Error: r/gems/gpgme-2.0.11/lib/gpgme/ctx.rb:385:in `import_keys': Unsupported protocol (GPGME::Error)
The text was updated successfully, but these errors were encountered: