Questions tagged [keytool]

Key and Certificate Management Tool: manages a keystore (database) of cryptographic keys, X.509 certificate chains, and trusted certificates.

Keytool is a key and certificate management utility. It allows users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and authentication services, using digital signatures. It also allows users to cache the public keys (in the form of certificates) of their communicating peers.

1325 questions
44
votes
3 answers

How to add certificate chain to keystore?

I have file with chain of certificates - certificate.cer: subject=/C... issuer=/C=US/O=VeriSign, Inc... -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- subject=/C=US/O=VeriSign, Inc... issuer=/C=US/O=VeriSign, Inc... -----BEGIN…
Volodymyr Bezuglyy
  • 16,295
  • 33
  • 103
  • 133
42
votes
6 answers

Android keystore password change

I would like to change the password I use in my keystore for an android app that is already available in google play and I would like to know some things before I do it: 1) If I change the keystore password, could I continue using the same keystore…
fapps
  • 1,799
  • 3
  • 15
  • 18
42
votes
5 answers

How to print the public key of a certificate using keytool?

Is there a way in keytool to print the publick key of a certificate? I tried: keytool -printcert -file client.crt But it gives only the following information: Owner: CN=client, OU=as, O=as, L=as, ST=as, C=as Issuer: EMAILADDRESS=as, CN=ca, OU=as,…
Ashwin
  • 12,691
  • 31
  • 118
  • 190
41
votes
8 answers

Published Android apk gives error "Package file was not signed correctly"

I recently uploaded my application to the android market however it's refusing to run when downloaded due to the error Package file was not signed correctly I first published the packet using eclipse, right click export, creating a keystore then…
David Read
  • 635
  • 2
  • 9
  • 13
41
votes
4 answers

Do you not need a password to access a truststore (made with the java keytool)?

I just created a truststore with the java keytool (for server authentication of a server that does not have a CA cert). However I just noticed something strange. I am starting my client like this: java…
sixtyfootersdude
  • 25,859
  • 43
  • 145
  • 213
41
votes
9 answers

What causes keytool error "Failed to decrypt safe contents entry"?

I am trying to convert a standard PKCS #12 (.p12) key store into a Java JKS key store with this command: keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12 -deststoretype JKS -destkeystore keystore.jks It is failing with: keytool…
Pedro Rolo
  • 28,273
  • 12
  • 60
  • 94
40
votes
7 answers

Keytool generates 32 character long key hash instead of 28

I am using the following command to generate key hash for Facebook app console for Android .\keytool.exe -exportcert -alias app_android -keystore release.keystore | openssl sha1 -binary | openssl base64 As told at Facebook developers SDK help As…
Jalpesh
  • 1,104
  • 1
  • 13
  • 25
40
votes
3 answers

Programmatically Import CA trust cert into existing keystore file without using keytool

I would like to create a JAVA program that import the .cer CA into the existing keystore file. So that end-user can insert the CA cert more convenience(without using CMD and key in the command). Is that anywhere that JAVA code can do this? i try…
user2767117
  • 921
  • 1
  • 7
  • 7
36
votes
3 answers

TOMCAT SSL Error: Alias name does not identify a key entry

I am trying to configure Tomcat 6 using SSL with a certificate provided to us (by someone). My SSL experience only spans a few days, but I still have to configure the darn thing. I was provided a certificate (downloaded from IE) in DER format. Next…
udeleng
  • 866
  • 2
  • 14
  • 20
36
votes
2 answers

Keytool's -storepass vs. -keypass -- Why 2 passwords?

I understand that the -keypass option is for "the password for the key" and that the -storepass option is for "a password for the keystore". I don't understand, however, why two passwords are needed. What scenarios are there for requiring 2…
ef2011
  • 10,431
  • 12
  • 49
  • 67
36
votes
4 answers

Add password to keytool command

I've made a .bat file to get the SHA1 of my Android app so I don't need to type the command each time keytool -list -v -keystore "Path/To/My/Key.jks" When I run the bat file I get asked for the password. Is it possible to either put the password in…
TMH
  • 6,096
  • 7
  • 51
  • 88
35
votes
1 answer

keytool error: java.lang.Exception: Keystore file exists, but is empty

I am new to SSL. I am trying to create keystore for SSL connection using keytool. First I tried the following command [aniket@localhost bin]$ keytool -genkey -alias myKeyStore -keyalg RSA -keystore /home/aniket/keystore It asked me password and…
Aniket Thakur
  • 66,731
  • 38
  • 279
  • 289
34
votes
3 answers

Keytool set hostname

I am just attempting to use the java keytool but I cannot figure out how to set the hostname. This is what is how I am attempting: hostname[username:/this/is/a/path][640]% keytool -keystore server.keystore -genkeypair -alias hostname Enter…
sixtyfootersdude
  • 25,859
  • 43
  • 145
  • 213
33
votes
7 answers

keytool error: java.lang.Exception: Failed to establish chain from reply

Generate keystore: keytool -genkey -alias tomcat -keyalg RSA -keystore my.keystore -keysize 2048 Generate certificate signing request (CSR): keytool -certreq -alias tomcat -keyalg RSA -file my.csr -keystore my.keystore I then go off to my hosting…
Edd
  • 8,402
  • 14
  • 47
  • 73
32
votes
16 answers

Access denied when creating keystore for Android app

I am trying to sign my Android app so I can release it in Market. When I generate the keystore, I get an access denied error. How do I fix this? This is what I've been trying to do: Right click project in Eclipse Helios. Android Tools > Export…
JoJo
  • 19,587
  • 34
  • 106
  • 162
1 2
3
88 89