title: Keytool generates 32 character long key hash instead of 28
body: <p>I am using the following command to generate key hash for Facebook app console for Android</p>
  
  <pre><code>.\keytool.exe -exportcert -alias app_android -keystore release.keystore | openssl sha1 -binary | openssl base64
  </code></pre>
  
  <p>As told at <a href="https://developers.facebook.com/docs/android/getting-started#release-key-hash" rel="noreferrer">Facebook developers SDK help</a></p>
  
  <p>As per the help page and also the developers console, the key hash should be 28 characters long, however the keytool is generating 32 characters long key.</p>
  
  <p>Java version : jdk1.8.0_31
  OS : Windows 7</p>
  
  <p>Generating for android. </p>
  
  <p>EDIT</p>
  
  <p>As per suggestion from @Shreyash-mashru, I used the following code to get the keyhash</p>
  
  <pre><code>try {
          PackageInfo info = getPackageManager().getPackageInfo(
                  "my.package.name",
                  PackageManager.GET_SIGNATURES);
          for (Signature signature : info.signatures) {
              MessageDigest md = MessageDigest.getInstance("SHA");
              md.update(signature.toByteArray());
              Log.e("KeyHash:", "++++++++++++++++++++++++++++++++++++++" + Base64.encodeToString(md.digest(), Base64.DEFAULT));
          }
      } catch (PackageManager.NameNotFoundException e) {
          Log.e("KeyHash:", "++++++++++++++++++++++++++++++++++++++" + e.toString());
  
      } catch (NoSuchAlgorithmException e) {
          Log.e("KeyHash:", "++++++++++++++++++++++++++++++++++++++" + e.toString());
      }
  </code></pre>
  
  <p>However if someone can still help me out understand why the command line tool is generating 32 char long key hash instead of 28... </p>