How to use Android KeyStore

Source: Internet
Author: User

Android generates KeyStore, two ways

First, build Android KeyStore in eclipse

Build any Android project (ex: Antforandroid)

Right-antforandroid root popup menu->android Tools, Export signed application package ...

Next >

Select "Create new KeyStore" and save in a directory (this example is saved in the project and directory) enter the password, then next

Fill in some information, fill in the alias and password do not forget

This generates the androids.keystore generated by the above process in the project root directory.

Second, command line generation KeyStore

DOS access to the JDK Bin directory

Run the following command:

Keytool-genkey-alias android.keystore-keyalg rsa-validity 20000-keystore android.keystore

(-validity 20000 represents the number of days of validity), and when the command is completed, the Android.keystore is generated in the bin directory

Example:
C:\Program Files (x86) \java\jdk1.8.0_25\bin>

Keytool-genkey-alias test.keystore-keyalg rsa-validity 20000-keystore d:\test.keystore

-alias test -generated keystore aliases

-keyalg RSA Encryption and digital Signature Algorithm

-validity 20000 Effective Days

Enter KeyStore Password: 123456
Enter new password again: 123456
What is your first and last name?
[Unknown]: Robert
What is the name of your organizational unit?
[Unknown]: Google
What is your organization's name?
[Unknown]: Google
What is the name of your city or region?
[Unknown]: Nanjing
What is the name of your state/province?
[Unknown]: Jiangsu
What is the two-letter country/region code for this unit?
[Unknown]: CN
Cn=robert, Ou=google, O=google, l=nanjing, St=jiangsu, C=CN right?
[No]: Y

Enter the key password for <test>
(If the KeyStore password is the same, press ENTER):

If there is no error then go back to the D packing directory, more Test.keystore

Third, view KeyStore

1. Eclipse View


Note: No password KeyStore can be displayed, there is no password to see.

2. Command line view (can view keystore with password)

To view the information in Certificate KeyStore, run the following command:

Keytool-list-v-keystore [Enter keystore name]-storepass [Enter KeyStore password]

To output a KeyStore certificate information to a text file, run the following command:

Keytool-list-v-keystore [Enter keystore name]-storepass [Enter keystore password] > keystoreOutput.txt




How to use Android KeyStore

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.