stillbornwolf / android-privacy-guard

Automatically exported from code.google.com/p/android-privacy-guard
0 stars 0 forks source link

APG fails to import secret key - key doesn't show up without giving errors #73

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Tried to import a secret key generated with gnupg on Linux years ago. Key type 
is DSA 1024 bit. The key doesn't show up in the list of private keys, even 
though APG claims that it has added one (or updated whenever I try again) so 
apparently it's there but not shown.
Other keys (and public keys, even the corresponding public key of the 
problematic secret key) work fine.
I tried both binary .gpg and ascii .asc files and I already deinstalled and 
reinstalled AGP several times, trying with a fresh keyring but to no avail.
I really need to get this specific key working, as it carries many qualified 
signatures.
Signing, encrypting/decrypting with other keys works just fine though I have 
encountered a signature that's reported broken in k9 mail whereas it's ok in 
Thunderbird on Windows but that's unrelated.
APG version is v1.0.7 on Android 2.1-update1 on a Motorola Milestone/Droid

Original issue reported on code.google.com by duncan.b...@googlemail.com on 17 Sep 2010 at 12:47

GoogleCodeExporter commented 8 years ago
Hmm. How annoying. Is there anything else that is unusual? How large is the key 
data? I'm trying to guess what could prevent the key from being shown after it 
was written to the DB... I can't dream up anything likely.

Perhaps we could make a debug build (or even a debug feature) to allow reading 
some low-level data (nothing compromising, of course) to help with this.

Original comment by thialfi...@gmail.com on 26 Sep 2010 at 5:36

GoogleCodeExporter commented 8 years ago
The key has two ELG subkeys (1024 and 2048 bytes) which might be unusual enough 
to cause problems. I tried to edit a copy of the key and delete the second 
subkey using gpg on a Linux shell and import that but apparently without any 
difference.
An ascii armored key export using Thunderbird+Enigmail is 40 kb (public + 
private) or 4 kb (private only) in size. I'm using Enigmail Version 1.1.2.
Strange is that the combined key data (public + private) gets imported into the 
public keychain in APG without eny problem. The public part is the bigger one 
of course due to several signatures.

Original comment by duncan.b...@googlemail.com on 26 Sep 2010 at 5:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Same here for keys exported via GPA or Kleopatra.
After exporting the same key with Thunderbird/Enigmail the import works fine.

Great App, thx a lot!

Original comment by realbigm...@googlemail.com on 15 Apr 2011 at 5:24

GoogleCodeExporter commented 8 years ago
I still cannot import my private key here :( 
I have exported my key using OpenGPG to file $something-pub-sec.asc

Original comment by zakiakh...@gmail.com on 4 Aug 2011 at 8:46

GoogleCodeExporter commented 8 years ago
Still no luck with APG 1.0.8. Tried to export the key again, now with 
Thunderbird 5 and Enigmail 1.2.1 but APG still just says that it updated one 
key but still doesn't display anything.

Original comment by duncan.b...@googlemail.com on 6 Aug 2011 at 5:33

GoogleCodeExporter commented 8 years ago
Same problem here. APG is the most fresh from Market, keys exported by 
Kleopatra, error is "Java.io.IOException: unknown object in stream"

Original comment by argent...@gmail.com on 23 Oct 2011 at 8:33

GoogleCodeExporter commented 8 years ago
I too am having the issue described by the original poster. I have a key 
comprised of 
2048 RSA. Also the name on the key is the same as the other key I have 
currently installed - not sure if this would cause an issue. (using 1.0.8 on 
Android 2.3.3 - Droid X)

Original comment by redline...@gmail.com on 8 Dec 2011 at 11:16

GoogleCodeExporter commented 8 years ago
Please visit the web
http://blog.andreas-haerter.com/2011/01/03/gnupg-gpg-pgp-on-android-with-apg-and
-k-9-mail

Use the GPG export the private key.
gpg -ao ~/privkey.asc --export-secret-key KEY-ID
It is Ok for me. ^.^

Original comment by davidyip...@gmail.com on 12 Dec 2011 at 11:07

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Having the same problem. Installed APG, then K9. Placed MY SECRET KEY.asc on 
the SD card. Went to import Secret Key, used a file manager getting correct 
file path (Not "gmail" path), error says: "NO KEY ADDED OR UPDATED".

I recently did this on another phone, and it worked perfectly. Now all of a 
sudden it wont work. Anyone have any idea how to fix this?

Original comment by privacy....@gmail.com on 2 Feb 2012 at 3:36

GoogleCodeExporter commented 8 years ago
"Having issues importing a secret key to APG." - SOLVED

Installed Thunderbird & Enigmail

Installed GPG4win

Imported Private Key to GPG4Win

Pointed Enigmail to GPG4Win file GPG2.exe

Imported Private Key to Enigmail

Exported Private key from Enigmail to desktop

Dropped exported private key on phone SD Card

Imported Private key to APG

SUCCESS!

Original comment by privacy....@gmail.com on 2 Feb 2012 at 11:23

GoogleCodeExporter commented 8 years ago
APG cannot import keys in .asc files terminated with CR/LF (PC-style): it 
requires LF only (UNIX style). If your PC editor offers you a choice (e.g., 
TextPad does) save the file as UNIX text.

Original comment by enzom...@gmail.com on 25 Jul 2012 at 11:57

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
gpg -ao ~/privkey.asc --export-secret-key KEY-ID
As mentioned previously works. Comparing the output from that to what I get out 
of Kleopatra & GPA on my Windows box I only get the -----BEGIN PGP PRIVATE KEY 
BLOCK----- section without the corresponding Public key block.

I assume you could trim the public key section out & get the other output to 
work. I had no luck fiddling around with files containing both blocks moving 
from windows format to UNIX format.

Original comment by devin.n...@gmail.com on 25 Feb 2013 at 3:52

GoogleCodeExporter commented 8 years ago
I have the same problem. Just to help, here is a throwaway private key I 
generated that I'm trying to import. The password is "foo". Please give it a 
go, should be easy to spot the issue I'm sure!

Original comment by matthew....@gmail.com on 14 Apr 2013 at 11:05

Attachments:

GoogleCodeExporter commented 8 years ago
> gpg -ao ~/privkey.asc --export-secret-key KEY-ID

Worked for me too.

Original comment by matthew....@gmail.com on 14 Apr 2013 at 11:10

GoogleCodeExporter commented 8 years ago
My recommendation is: After export (backup) keys from GNU (at PC) edit keys in 
TextPad editor. http://www.textpad.com/ Removing blank lines from the key. 
Split into two files - public and private key. Save as UNIX and UTF-8.

Original comment by RomanPoh...@gmail.com on 2 Sep 2013 at 9:37

GoogleCodeExporter commented 8 years ago
Workaround ::

Without changing the contents of secret key , RENAME the file to 
"private-key.asc". {Without the double quotes}
Then try importing.
It Worked For ME. Hopefully it works for you too.

Original comment by ashish52...@gmail.com on 23 Jul 2014 at 4:46

GoogleCodeExporter commented 8 years ago
Solution at #19 worked for me too, 4 secret keys of various complexity loaded 
without error with no other changes apart from  renaming the file. .  My keys 
were  exported from  PGP v9. Thanks for finding it Ashish! 

Original comment by JonFawbe...@gmail.com on 19 Aug 2014 at 5:48