Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fingerprint is null when importing a key on non english GPG version #36

Open
ValkA opened this issue May 19, 2019 · 1 comment
Open

Comments

@ValkA
Copy link

ValkA commented May 19, 2019

Can be temporarily fixed by adding environment variable LANG=en.

The fingerprint is null because of the following regex in gpg.js which assumes English output:
var keyRegex = /^gpg: key (.*?):/;

@steppefox
Copy link

steppefox commented Feb 26, 2021

Well, ideally your server should be set in English. If for some reason, you need any other language set in your system, you can implement a custom import function. Basically:

  • copy paste import function from source code: https://github.com/drudge/node-gpg/blob/master/lib/gpg.js#L248 to your target file
  • Inside of that copy-pasted function, replace spawnGPG(keyStr, defaultArgs, args, function(importError, result) { with gpg.call(keyStr, defaultArgs, function(importError, result) {
  • Change keyRegex to desired one that'll fix your issue
  • Use your custom import function, instead of gpg.import

Another solution - simply fork the package and fix that keyRegex :D Use your fork instead of the package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants