title: How to generate 11 char hash key for Sms Retriever with Google App signing
body: <p>I had generated the 11 char hash using the <code>AppSignatureHelper</code> class. But after uploading the apk to play store, they hash doesn't work anymore. And I found out that Play replaces the key with another one which is why the hash gets changed as well. Now I'm having trouble getting the 11 char hash key.</p>
  
  <p>I don't know how to use the commands given by Google. I found this command from <a href="https://stackoverflow.com/a/50600769/4961874">here</a></p>
  
  <p><code>keytool -exportcert -alias MyAndroidKey -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11</code></p>
  
  <p>Since, Play App signing is enabled for my app, I'll have to use this command, </p>
  
  <p><code>keytool -exportcert -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
  </code></p>
  
  <p>I've replaced <code>keytool</code> with its path from the JDK's bin folder but then it was saying <code>xxd</code> was not recognized so I downloaded it from a website now it's saying <code>tr</code> is not recognized, I guess it'll say that for <code>cut</code> as well. </p>
  
  <p>Please pardon me if it seems too noob of me asking it, but how can I resolve this?</p>
  
  <p><strong>UPDATE:</strong> I've tried the second command from above on a linux machine, the command worked and gave me 11 character hash but still the SMS Retriever is not working. </p>
  
  <p><strong>SOLUTION:</strong> With the help of Nick Fortescue's answer, I downloaded the DER formatted file. Then converted it to a .jks file using the following command,</p>
  
  <p><code>keytool -importcert -alias myalias -file deployment_cert.der -keystore certificate.jks -storepass mypassword</code></p>
  
  <p>Then performed the first command from above on certificate.jks and it worked!</p>