easy-gpg-to-paper icon indicating copy to clipboard operation
easy-gpg-to-paper copied to clipboard

Support import of multiple barcodes in single png

Open gthieleb opened this issue 5 years ago • 0 comments

Steps to prepare:

  1. Export the key to png
./gpg2paper.py export --keyid 123213232 --png --out ~/.gnupg/123213232.png
  1. Place the created barcodes into a single paper (using imagemagick)
montage -mode concatenate -tile 2x ~/.gnupg/123213232.png* ~/.gnupg/123213232-full.png
  1. Import the created image
./gpg2paper.py import --png --pubkey ~/.gnupg/123213232.pub --in ~/.gnupg/123213232-full.png

Current behavior

/gpg2paper.py import --png --pubkey ~/.gnupg/123213232.pub --in ~/.gnupg/123213232-full.png 
scanned 4 barcode symbols from 1 images in 0.56 seconds

Traceback (most recent call last):
  File "./gpg2paper.py", line 274, in <module>
    sys.exit(main())
  File "./gpg2paper.py", line 109, in main
    do_import(args)
  File "./gpg2paper.py", line 125, in do_import
    return import_from_b64(args.pubkey, base64.b64decode(base64str))
  File "/home/gt01/.virtualenvs/gpg/lib64/python3.7/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

Desired behavior

Key should be imported successfully.

gthieleb avatar Aug 26 '19 07:08 gthieleb