Get subject key identifier from certificate
<p>Is it possible to extract the <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.2" rel="nofollow">subject key identificator</a> from an existing certificate with python? </p>

<p>I tried someting like:</p>

<pre><code>from OpenSSL.crypto import load_certificate, FILETYPE_PEM

cert_string='-----BEGIN CERTIFICATE--...'
certificate=load_certificate(FILETYPE_PEM, plain_cert)
subject=certificate.get_subject()
</code></pre>

<p>But it gives back the subject of the certificate. It seems like the certificate object doesn't offer functions for the subject key identifier. Are there other options?</p>

<pre><code>subject=certificate.get_extension(0)
</code></pre>

<p>did the job. With </p>

<pre><code>certificate.get_extension_count()
</code></pre>

<p>you can check how much extensions the certificate has.</p>

python cryptography certificate pyopenssl