Resources : Blog

Android MapView Generate API key Using JAVA Keytool

By aditya in Android

May 27, 2010

< All >

What is keytool ?

Java Keytool is a key and certificate management utility. It allows users to manage their own public/private key pairs and certificates. It also allows users to cache certificates. Java Keytool stores the keys and certificates in what is called a keystore. By default the Java keystore is implemented as a file. It protects private keys with a password. A Keytool keystore contains the private key and any certificates necessary to complete a chain of trust and establish the trustworthiness of the primary certificate.
Each certificate in a Java keystore is associated with a unique alias. When creating a Java keystore you will first create the .jks file that will initially only contain the private key. You will then generate a CSR and have a certificate generated from it. Then you will import the certificate to the keystore including any root certificates. Java Keytool also several other functions that allow you to view the details of a certificate or list the certificates contained in a keystore or export a certificate.
Note: For easier management of your Java Keystores (using a GUI) check out Portecle. If you need to buy a certificate, try to compare SSL with our SSL Wizard.

Steps to be followed

1) Go to Command prompt
2) Generate MD5 Key using java keytool.
3) Fill the information for the key.
4) Get the md5 key.
5) Register it with google.
6) Get the API Key from The google.
7) Use the API key in your application

Description

1) In windows start command promt :
press “ Widow key + r” run diaolg will apear
type cmd and press enter
OR
Press widows key then in search bar type cmd select command prompt from the list.
Then change directory to jdk/bin
e.g c:/…./java/jdk.16/bin

2) Enter the following command…
keytool –genkeypair -alias (alias_name) -keypass (password)
e.g. keytool -genkeypair -alias andy -keypass android

3) Fill the information form.

After running the above command you will find .keystore file generated at your home folder
C:\Users\…\.keystore

4) Run the following command to get Certificate fingerprint (MD5):
keytool -list -alias -keystore .keystore
e.g. keytool -list -alias andy -keystore c:\Users\..\.keystore

5) After getting the key, register the key with google, on the following link

http://code.google.com/android/maps-api-signup.html

6) Follow the steps and you will get the API key.

7) Use that key in your android/iPhone application.

For detailed use of key tool go to following link

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html

  • Sean

    Spot on with this write-up, I actually believe
    this amazing site needs much more attention. I’ll probably
    be returning to read more, thanks for the info!

  • 新作 エコバッグ 注目

    Hi! I’ve been reading your weblog for a long time
    now and finally got the courage to go ahead and give
    you a shout out from New Caney Tx! Just wanted to mention keep up the good work!

  • http://www.alttervista.org/%E2%97%86kate-spade-%E3%82%B1%E3%82%A4%E3%83%88%E3%82%B9%E3%83%9A%E3%83%BC%E3%83%89-%E2%97%86%E3%83%87%E3%82%B6%E3%82%A4%E3%83%B3%E6%9F%84%E3%83%88%E3%83%BC%E3%83%88%E3%83%9 秋冬 スクエアトゥ

    Way cool! Some very valid points! I appreciate you writing this article and the
    rest of the website is very good.