Skip to content

Support import of multiple barcodes in single png #12

@gthieleb

Description

@gthieleb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions