title: How to get/generate pin sha256 from certificate
body: <p>Simple question</p>
  <p>I am trying to do certificate pinning in android using the network-security-config
  but I am not sure how to get the the SHA-256 to put in the pin-set</p>
  <p>Given a domain url how do you find the &quot;pin digest=&quot;SHA-256&quot;?</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
    &lt;network-security-config&gt;
      &lt;domain-config&gt;
          &lt;domain includeSubdomains=&quot;true&quot;&gt;example.com&lt;/domain&gt;
          &lt;pin-set expiration=&quot;2018-01-01&quot;&gt;
              &lt;pin digest=&quot;SHA-256&quot;&gt;HowDoIGetThisValue&lt;/pin&gt;
              &lt;!-- backup pin --&gt;
              &lt;pin digest=&quot;SHA-256&quot;&gt;HowDoIGetThisValue&lt;/pin&gt;
          &lt;/pin-set&gt;
      &lt;/domain-config&gt;
  &lt;/network-security-config&gt;
  </code></pre>
  <p>Suggestions/Steps.</p>
  <p>many thanks</p>