Export/Import of pgp keyfiles to Openkeychain on android

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
NChewie
Level 4
Level 4
Posts: 222
Joined: Wed Oct 15, 2014 8:46 am
Location: Ireland

Export/Import of pgp keyfiles to Openkeychain on android

Post by NChewie » Wed Sep 28, 2016 6:31 am

I am using PGP via Seahorse and the command line, on my main edition (Cinnamon 17.3 64bit).
Everything works fine for encrypting/decrypting and signing files.

I wanted to set up some app to allow me to send and receive secure email attachments from my android phone. My first choice was K9-mail and APG.

On my laptop, I exported my private key and public keys with the .asc suffix using

Code: Select all

gpg --export-secret-keys --armor [my-id] > private-key.asc

Code: Select all

 gpg --export --armor [my-id] > public-key.asc
and copied both files to the phone internal Downloads directory, when connected over USB.

When I installed APG on my Android v6.0 phone (HTC1 M8) and tried to select either of the key files to import, none of them were shown in that Downloads directory. Everything else in that directory was visible, including pdf files, tif files, doc files, txt files...
I tried to change the suffix of one file (as a hack) to .pdf, but this did not make it visible in that directory to APG.
I uploaded the files onto my google drive and tried to import them on the phone from it... but again, the phone could see all the other content but not the files with .asc suffixes.

I uninstalled APG and installed Openkeychain on my phone. The same issue persisted - that app cannot see the copies of the exported keys but could see all other content on the Downloads directory and on the Google Drive! :evil:

I then installed OIFilemanager app and noted that it appeared as the bottom of the list in the Openkeychain <Open from> menu.
When I opened it, I found that it could find files in a directory it referred to as:
storage>6235-6665>Download
which equated to a directory on my laptop shown as:
Android Phone>SanDiskSD Card>Download

[UPDATE 28 September 2016 --- I have a new Huawei P9 lite phone running Android 6.0 and on it, Openkeychain version 4.1 was able to find/read and import files using the "Files" option without the need for OIFilemanager ]

From there, I was able to import my private-key.asc file and public-key.asc file successfully. :D

I now use the Mailwise app on my phone and can send fully encrypted emails from linux using Thunderbird with enigmail add-on.
If an incoming fully encrypted message is received on Mailwise, it offers the option to enter the passphrase through Openkeychain and then decryptes to show the text and attachment :P

(I was hoping to use k9-mail (so I could create encrypted emails from the phone) but have never had success in setting it up.)
Toshiba Satellite Pro C650-191 LM19.1 Cinnamon

Post Reply

Return to “Tutorials”