Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keytool do not ask for alias password

I'm trying to generate a keystore file to sign my React Native Android app and publish it to Play Store.

I'm trying to do it as described in this docs: https://facebook.github.io/react-native/docs/signed-apk-android.html. Basically, I'm running the following in the terminal: keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000.

This command asks for the keystore password, but not for alias password. I need the alias password to setup my App Center build and to sign as described in the docs above. Can't understand where's is it stored.

Thank you!

like image 442
Sergey Avatar asked Apr 01 '18 13:04

Sergey


People also ask

Can I create a keystore without password?

You cannot create a keystore with a blank password with keytool since a while, but you can still do it programmatically.

What is alias in Keytool command?

An alias is specified when you add an entity to the keystore using the -genseckey command to generate a secret key, -genkeypair command to generate a key pair (public and private key) or the -importcert command to add a certificate or certificate chain to the list of trusted certificates.

What is Storepass and Keypass in Keytool?

Keytool uses storepass and keypass for different purposes. storepass is used to access the key store. keypass is used to access the particular key pair's private key. However, a password should not be specified on a command line or in a script unless it is for testing purposes, or you are on a secure system.


1 Answers

I've found a solution. The reason was that my keytool version generates PKCS12 keystore, non JKS. As it says Different store and key passwords not supported for PKCS12 KeyStores.

So I was able to generate a JKS file by passing -storetype jks parameter (and it asked for two passwords). And now it says The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using...

like image 174
Sergey Avatar answered Oct 04 '22 08:10

Sergey