Open szszszsz opened 5 years ago
Added draft of the solution to repository, in a separate branch. To use it please run:
$ git clone https://github.com/Nitrokey/gnupg-docker.git -b 4-integrate-nitroinit gnupg-docker-nitroinit
$ cd gnupg-docker-nitroinit
$ ./docker-build.sh
# (Build messages ...)
$ ./docker-run.sh
# (Execution messages ...)
$ ./nitroinit.py
This will build and run environment, and the last one is used to run Nitroinit.
Edit: git
is required to automatically download the repository with Nitroinit during the installation.
Edit: link to branch code: https://github.com/Nitrokey/gnupg-docker/tree/4-integrate-nitroinit
When executing nitroinit, it fails:
./nitroinit.py --expert
Nitroinit - Create and import GnuPG keys to the Nitrokey
No keyfile was provided. We create a new key, back it up and then import it to the Nitrokey.
You can provide an existing key via '--keyfile' flag. Please use '--help' for more information.
We start key creation now...
Please select the algorithm and size you want:
(1) RSA 2048
(2) RSA 3072
(3) RSA 4096
(4) NIST P-256
(7) Brainpool P-256
Your selection? 4
Please provide a user ID to identify your key.
Enter the name for the user ID: Bla
Enter the email address for the user ID: info@example.com
Enter a comment to include (optional):
Traceback (most recent call last):
File "./nitroinit.py", line 227, in <module>
main(args.keyfile, args.expert)
File "./nitroinit.py", line 179, in main
keyfile = create_key(expert)
File "/app/nitroinit/keycreation.py", line 115, in create_key
pubdata = c.key_export(newkey.fpr)
File "/usr/lib/python3/dist-packages/gpg/core.py", line 128, in __getattr__
func = getattr(gpgme, name)
AttributeError: module 'gpg.gpgme' has no attribute 'gpgme_key_export'
sudo docker pull ubuntu:rolling
edit: typo
It does work with RSA. sudo docker pull ubuntu:rolling
doesn't help.
I see. Will check again for ECC. It looks like the cause is on the Python bindings side.
Perhaps it would be easier for this setup to just switch to Arch Linux Docker image altogether, instead of trying to run it on Ubuntu: https://hub.docker.com/r/archlinux/base/.
Integrate another tool, Nitroinit, to project. It would be especially useful due to latest version of the GPGME, which is required by this project to run correctly.