gpgme

PHP GnuPG - Signing message fails

最后都变了- 提交于 2021-02-04 21:27:06
问题 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

PHP Gnupg is not showing up as an extension in phpinfo() and I can't use it in php

别等时光非礼了梦想. 提交于 2020-01-24 00:45:09
问题 I have gnupg and gpgme installed using homebrew. I also linked both and made sure they are installed and linked by running brew gnupg install and brew gpgme install and got the message confirming the installation and the version. I have placed the gnupg.so file in the extension path and also added extension=gnupg.so into the php.ini file. I got the extension path and the specific php.ini's path from the infophp page. After restarting mamp, I still don't see gnupg or gpgme as extensions on

search for a public key on a keyserver with GPGME

邮差的信 提交于 2020-01-01 12:25:11
问题 Today I started a new thread on gnupg mailing list, Search keys on a keyserver with GPGME. Basically I use GPGME as an interface to use GnuPG in my app, but I don't know how I can use GPGME functions to search for a key on a keyserver. Any idea? 回答1: Ok, I found the answer for this problem. Using gpgme_op_conf_load , gpgme_conf_arg_new , gpgme_conf_opt_change and gpgme_op_conf_save it is possible to set a new preference, in this case the keyserver url. -- Cheer, José 来源: https://stackoverflow

Unexpected Struct while using GPGME in C++ Application

◇◆丶佛笑我妖孽 提交于 2019-12-13 07:27:09
问题 I would like to use GPGME for key generation and encryption in my C++ application. However, while trying to get started, I got stuck with a problem: I dowloaded the dev package for my debian system. I told my compiler how to find the library. Just to see if I 'm able to initialize the library (mentioned here) I try to execute the following code..: //--- Main.cpp--- #include <locale.h> #include <gpgme.h> int main(){ /* Initialize the locale environment. */ setlocale (LC_ALL, ""); gpgme_check

Problem decrypting PGP in python with pyme without user interaction

倖福魔咒の 提交于 2019-12-12 09:27:21
问题 I am trying to decrypt messages using pyme (a python wrapper from gpgme). It works fine if I type in the password when it prompts but I cannot get the passphrase callback to work. Here is the code import pyme.core def Callback( x, y, z ): print 'in passphrase callback' return 'passphrase' plain = pyme.core.Data() cipher = pyme.core.Data(sys.stdin.read()) c = pyme.core.Context() c.set_armor(1) c.set_passphrase_cb(Callback) c.op_decrypt( cipher, plain ) plain.seek(0,0) print plain.read() When I

Using GPGME in Debian for C++ Application

最后都变了- 提交于 2019-12-11 18:36:58
问题 I would like to use GPGME for key generation and encryption in my C++ application. However, while trying to get started, I got stuck with a problems: I dowloaded the dev package for my debian system. Now I would like to tell my compiler (gcc in Qt Creator) where to find the library with cmake using the tool mentioned in the documentation. But I don't know how to add gpgme-config --cflags --libs to my compiler flags. This didn't work: SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} `gpgme-config -

Ruby GPGME - How to encrypt large files

拟墨画扇 提交于 2019-12-11 11:52:38
问题 I'm having difficulty to Encrypt large files (bigger than available memory) using GPGME in Ruby. #!/usr/bin/ruby require 'gpgme' def gpgfile(localfile) crypto = GPGME::Crypto.new filebasename = File.basename(localfile) filecripted = crypto.encrypt File.read(localfile), :recipients => "info@address.com", :always_trust => true File.open("#{localfile}.gpg", 'w') { |file| file.write(filecripted) } end gpgpfile("/home/largefile.data") In this case I got an error of memory allocation: "read: failed

how to bypass pinentry (passphrase screen) while decrypting a file using gpgme

核能气质少年 提交于 2019-12-11 00:44:35
问题 I am trying to decrypt a file from the server where I have the required public key of that server. The keyring has a password protection and so when I try to decrypt a file, it asks me for a passphrase. Is there a way to bypass that passphrase by passing the password when we try to decrypt the file. I am using gpg-agent where the passphrase is cached for 600sec default time and for some reason I am unable to set the max-cache-ttl (It didn't work for me, I don't know y) and is availble only

Problem decrypting PGP in python with pyme without user interaction

爱⌒轻易说出口 提交于 2019-12-04 20:45:00
I am trying to decrypt messages using pyme (a python wrapper from gpgme). It works fine if I type in the password when it prompts but I cannot get the passphrase callback to work. Here is the code import pyme.core def Callback( x, y, z ): print 'in passphrase callback' return 'passphrase' plain = pyme.core.Data() cipher = pyme.core.Data(sys.stdin.read()) c = pyme.core.Context() c.set_armor(1) c.set_passphrase_cb(Callback) c.op_decrypt( cipher, plain ) plain.seek(0,0) print plain.read() When I run this and don't provide the password interactively the program then tries the Callback printing 'in

Using passphrase callback in ruby gpgme

空扰寡人 提交于 2019-11-30 23:31:31
I am using ruby gpgme gem (1.0.8). My passphrase callback isn't called: def passfunc(*args) fd = args.last io = IO.for_fd(fd, 'w') io.puts "mypassphrase" io.flush end opts = { :passphrase_callback => method(:passfunc) } GPGME.decrypt(input,output, opts) Does someone have working example of passphrase callback? Sample of callback you can find in the following working example. It signs a file in detached mode, i.e., the signature file is separated from the original file. It uses the default keyring at ~/.gnupg or something like that. To use a different directory for your keyring, set the