gnupg

Verify GPG file signature with Perl

烈酒焚心 提交于 2019-12-11 04:58:03
问题 I want to verify a GPG signed file (Verify archive.tar.gz with archive.tar.gz.sign). ATM I simply call gpg directly and parse the exit code and output. While this is a works-for-me solution, I figure there must be a nicer way to do this in a more perlish way. But as a programming novice I fail to understand how I can use the GPG CPAN modules. Any hints are much appreciated! 回答1: The GnuPG module on CPAN contains this in the synopsis: use GnuPG qw( :algo ); my $gpg = new GnuPG(); $gpg->verify(

I can’t get `git tag -s` to ask for my GPG password

怎甘沉沦 提交于 2019-12-11 02:39:53
问题 I can manually perform a gpg task that then prompts for my password via pinentry, with this password temporarily cached I can perform git tag -s and it works, other wise I get: gpg: signing failed: Operation cancelled gpg: signing failed: Operation cancelled error: gpg failed to sign the data error: unable to sign the tag I’m using Mac OS X 10.10.2 and have git and GnuPG 2.1 (modern) installed via homebrew. How can I get git tag -s to ask for my password? 来源: https://stackoverflow.com

Decrypt gpg file attached from email (file.pgp)

断了今生、忘了曾经 提交于 2019-12-11 02:16:59
问题 I'm using email.Message class and gnupg library to: 1 - parse email string fetched from Twisted imap4 client. 2 - get the attached file, a .pgp 3 - decrypt it. I can decrypt typical mail content, as: -----BEGIN PGP MESSAGE----- Version: PGP 9 (...) -----END PGP MESSAGE----- but the attachment affair is really making my life a hell. Well, I tried a lot of different ways, but the most logical should be this: message = email.message_from_string(content) if message.is_multipart(): attachment =

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

PHP gnupg 'import failed'

做~自己de王妃 提交于 2019-12-10 15:44:13
问题 I have been trying to use gnupg in PHP to encrypt a file that will be uploaded to an ftp folder. I am currently running on a mac using MAMP and I believe gnupg is installed correctly. I have a public key from the recipient of the file and when I try to import the key, either as a string literal or from a text file, I get the cryptic 'import failed' message from gnupg. $gpg = new gnupg(); $gpg->seterrormode(gnupg::ERROR_EXCEPTION); $gpg->import($key); //throws exception 'import failed' Is

gpg2 import of gpg1 secret key fails (gpg 2.1.15, Ubuntu 17.10)

℡╲_俬逩灬. 提交于 2019-12-10 14:59:06
问题 When I try importing my nicely-exported gpg1 keys using gpg2, the public key import works fine: gpg --import /path/to/publickey.gpg gpg: directory '/home/me/.gnupg' created gpg: new configuration file '/home/me/.gnupg/dirmngr.conf' created gpg: new configuration file '/home/me/.gnupg/gpg.conf' created gpg: keybox '/home/me/.gnupg/pubring.kbx' created gpg: /home/me/.gnupg/trustdb.gpg: trustdb created gpg: key ABCDEF1234567890: public key "Me <me@me.com>" imported gpg: Total number processed: 1

Maven GPG plugin not signing sources and javadoc jars

耗尽温柔 提交于 2019-12-10 14:17:29
问题 I'm attempting to release my project's artifacts to Sonatype using Maven. I'm using the Maven GPG plugin to sign the artifacts, but it's not signing the sources and javadoc jars (just the main jar), which is required by Sonatype. Here's what I think are the relevant parts of my pom.xml: <plugins> ... <plugin> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <phase>install</phase> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions>

What to put into ~/.gitconfig to imply --show-signature for every git subcommand that supports it?

时间秒杀一切 提交于 2019-12-10 04:45:05
问题 I just searched through the git-config(1), git-log(1) and git-show(1) man pages of git 2.6.2, but haven't found any hint that the --show-signature option (to e.g. git show or git log ) can be configured globally in my ~/.gitconfig for all git subcommands that support it. One option would be aliases, but since I don't know which subcommands all support it, that's just a workaround, not a solution. I guessed it may be core.show-signature = yes or core.showSignature = yes but that didn't change

PGP-signing multipart e-mails with Python

一个人想着一个人 提交于 2019-12-09 09:31:49
问题 I'm currently trying to add PGP signing support to my small e-mail sending script (which uses Python 3.x and python-gnupg module). The code that signs message is: gpg = gnupg.GPG() basetext = basemsg.as_string().replace('\n', '\r\n') signature = str(gpg.sign(basetext, detach=True)) if signature: signmsg = messageFromSignature(signature) msg = MIMEMultipart(_subtype="signed", micalg="pgp-sha1", protocol="application/pgp-signature") msg.attach(basemsg) msg.attach(signmsg) else: print('Warning:

git - gpg onto mac osx: error: gpg failed to sign the data

吃可爱长大的小学妹 提交于 2019-12-09 02:30:01
问题 I installed GPG from brew. brew install gpg It is gnupg2-2.0.30_2. When I commit, I do get a error message: You need a passphrase to unlock the secret key for user: "Max Mustermann (mycomment) <mm@test.de>" 2048-bit RSA key, ID 1111AAAA, created 2017-01-05 error: gpg failed to sign the data fatal: failed to write commit object I used the command: gpg --list-secret-keys | grep ^sec and it gives me back: sec 2048R/1111AAAA 2017-01-05 Then I used this command: git config --global user.signingkey