<div dir="ltr">Hi Paul,<div><br></div><div>If what you're trying to do is manipulate X.509 certificates and public keys, I think you'll have an easier time using the pyca/cryptography APIs, they're significantly richer and better tested -- and since pyOpenSSL depends on pyca/cryptography you already have a copy :-)</div><div><br></div><div><a href="https://cryptography.io/en/latest/x509/">https://cryptography.io/en/latest/x509/</a> are our X.509 docs, and <a href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/">https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/</a> are the docs for key serialization. Let us know if you have any questions.<br></div><div><br></div><div>Alex</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 20, 2017 at 8:14 AM, Paul King via Cryptography-dev <span dir="ltr"><<a href="mailto:cryptography-dev@python.org" target="_blank">cryptography-dev@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I am using pyOpenSSL to process a PEM certificate.<br>
<br>
>From the command line I can use ‘openssl x509 -inform pem -text -in 10.pem’ to process the certificate and can see:<br>
<br>
Signature Algorithm: ecdsa-with-SHA256<br>
<br>
However, when I try this in python with pyOpenSSL on my Mac, I struggle.<br>
<br>
Can someone advise me on how to process this type in python with pyOpenSSL?<br>
<br>
Code:<br>
<br>
    pub = cert.get_pubkey()<br>
    pub_asn1 = OpenSSL.crypto.dump_publickey( OpenSSL.crypto.FILETYPE_ASN1, pub )<br>
<br>
Similarly I want to do the same for the Subject Public Key:<br>
<br>
        Subject Public Key Info:<br>
            Public Key Algorithm: id-ecPublicKey<br>
                Public-Key: (256 bit)<br>
                pub:<br>
                    <-snip-><br>
                ASN1 OID: prime256v1<br>
                NIST CURVE: P-256<br>
<br>
<br>
Does that make sense for what I am trying to do, and should I be able to do this with pyOpenSSL?<br>
<br>
<br>
Thanks<br>
Paul<br>
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Cryptography-dev mailing list<br>
<a href="mailto:Cryptography-dev@python.org">Cryptography-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/cryptography-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/cryptography-<wbr>dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)<br>"The people's good is the highest law." -- Cicero</div><div dir="ltr">GPG Key fingerprint: D1B3 ADC0 E023 8CA6<br><div><br></div></div></div></div></div>
</div>