tridentli / trident

Trident is a trusted and secure communication platform for enabling better communication between groups of trusted parties
https://trident.li
Apache License 2.0
20 stars 9 forks source link

Trouble adding GPG/PGP key using tcli #123

Open davedittrich opened 6 years ago

davedittrich commented 6 years ago

I'm trying to pre-load users with Ansible, including adding the user's GPG/PGP key. It doesn't seem to work and the command help and error messages are unclear about how to proceed.

The help says this:

 pgp_add             <email> <keyring>    Add PGP key

An ASCII armored .asc file is usually not called a "keyring", but "Add PGP key" seems to suggests it wants a key file.

# tcli user email pgp_add dave.dittrich@gmail.com ~/dittrich.asc
An error occured: openpgp: invalid argument: no armored data found

The error message saying "no armored data found" would seem to confirm that an ASCII armored public key file is what it is expecting. The key is valid, as GPG will import it (and it has the email address as specified):

# gpg --import ~/dittrich.asc
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 945AB127: public key "Dave Dittrich <dave.dittrich@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

Taking a wild guess that it really does mean "keyring", let's try that.

root@purple:~# tcli user email pgp_add dave.dittrich@gmail.com /root/.gnupg/pubring.gpg
An error occured: openpgp: invalid argument: no armored data found

Had an idea this could be a line ending problem, so I tried dos2unix on the .asc file. Still no luck.

No idea what to do next or how to debug.

davedittrich commented 6 years ago

By the way, this is V1.4.5 from the Releases section.