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


1) In windows start command promt :
press “ Widow key + r” run diaolg will apear
type cmd and press enter
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

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

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

  • 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!

  • Samantha

    I drop a leave a response whenever I like a article on a
    site or I have something to add to the discussion.
    Usually it’s triggered by the sincerness communicated in the article
    I read. And on this post Android MapView Generate API key Using JAVA
    Keytool. I was actually moved enough to drop a thought :
    ) I do have a couple of questions for you if
    you usually do not mind. Is it just me or do some of the comments look
    as if they are left by brain dead individuals?
    :-P And, if you are writing on other social sites, I’d
    like to follow anything new you have to post.
    Would you make a list the complete urls of all your shared pages like
    your linkedin profile, Facebook page or twitter feed?

    Here is my weblog … スニーカー 通販, Samantha,