keytool-importkeypair icon indicating copy to clipboard operation
keytool-importkeypair copied to clipboard

Source keystore file exists, but is empty

Open denbard opened this issue 7 years ago • 4 comments

i`m using following cmd to generate an android signature: keytool-importkeypair -k demo.jks -p 123456 -pk8 platform.pk8 -cert platform.x509.pem -alias demo

demo.jks is generated from Android Studio.

And nothing occurs but an Exception: keytool error: java.lang.Exception: Source keystore file exists, but is empty: /tmp/keytool-importkeypair.WmlH/p12

I scanned the folder /tmp/, find no folders named keytool-importkeypair, so why this exception occurs?

denbard avatar Jun 16 '17 09:06 denbard

i got the same problem

[root@VM_16_15_centos linzq]# ./keytool-importkeypair -k demo.jks -p 123456 -pk8 platform.pk8 -cert platform.x509.pem -alias demo
Error decrypting key
140544181491616:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1199:
140544181491616:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:374:Type=PKCS8_PRIV_KEY_INFO
unable to load private key
139677144197024:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: ANY PRIVATE KEY
Importing "rejia_door" with unable to load certificate
140634201495456:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: TRUSTED CERTIFICATE
keytool error: java.lang.Exception: Source keystore file exists, but is empty: /tmp/keytool-importkeypair.tZt7/p12
[root@VM_16_15_centos tmp]# pwd
/tmp
[root@VM_16_15_centos tmp]# ll
total 16
drwxr-xr-x 2 root root 4096 Jun 18 10:50 hsperfdata_root
drwx------ 2 root root 4096 Jun 18 10:22 ssh-3BtUsMVWPg
drwx------ 2 root root 4096 Jun 18 10:49 ssh-DbvcF2cVao
drwx------ 3 root root 4096 Jul  6  2018 systemd-private-1b11ce59a39e4260a53ff49aa11c35cd-ntpd.service-He16JV
[root@VM_16_15_centos tmp]# 

linq8261 avatar Jun 18 '19 02:06 linq8261

Any updates on this ?

DarrelAeturnum avatar Jan 20 '20 05:01 DarrelAeturnum

Fixed: change the platform.pk8 and platform.x509.pem will ok. And: the -k option is specificing a file which will be generate,not specificing a existing file.

sjd168 avatar Apr 18 '20 02:04 sjd168

Fixed: change the platform.pk8 and platform.x509.pem will ok. And: the -k option is specificing a file which will be generate,not specificing a existing file.

能不能详细说下怎么解决的呢

HilbertPan avatar Feb 23 '22 16:02 HilbertPan