How can I create a keystore?

后端 未结 11 1270
北恋
北恋 2020-11-22 13:47

What are the steps to create a keystore for android?

I need to use google maps in my app and I don\'t know what steps I missed. Please provide me with the specific d

11条回答
  •  春和景丽
    2020-11-22 14:14

    I was crazy looking how to generate a .keystore using in the shell a single line command, so I could run it from another application. This is the way:

    echo y | keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias business -keypass kpi135 -keystore /working/android.keystore -storepass ab987c -validity 20000
    
    • dname is a unique identifier for the application in the .keystore

      • cn the full name of the person or organization that generates the .keystore
      • ou Organizational Unit that creates the project, its a subdivision of the Organization that creates it. Ex. android.google.com
      • o Organization owner of the whole project. Its a higher scope than ou. Ex.: google.com
      • c The country short code. Ex: For United States is "US"
    • alias Identifier of the app as an single entity inside the .keystore (it can have many)

    • keypass Password for protecting that specific alias.
    • keystore Path where the .keystore file shall be created (the standard extension is actually .ks)
    • storepass Password for protecting the whole .keystore content.
    • validity Amout of days the app will be valid with this .keystore

    It worked really well for me, it doesnt ask for anything else in the console, just creates the file. For more information see keytool - Key and Certificate Management Tool.

提交回复
热议问题