[Cryptography-dev] Processing public key algorithm 'ecdsa-with-SHA256'

Alex Gaynor alex.gaynor at gmail.com
Thu Apr 20 08:22:46 EDT 2017


Hi Paul,

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 :-)

https://cryptography.io/en/latest/x509/ are our X.509 docs, and
https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/
are the docs for key serialization. Let us know if you have any questions.

Alex

On Thu, Apr 20, 2017 at 8:14 AM, Paul King via Cryptography-dev <
cryptography-dev at python.org> wrote:

> Hi
>
> I am using pyOpenSSL to process a PEM certificate.
>
> From the command line I can use ‘openssl x509 -inform pem -text -in
> 10.pem’ to process the certificate and can see:
>
> Signature Algorithm: ecdsa-with-SHA256
>
> However, when I try this in python with pyOpenSSL on my Mac, I struggle.
>
> Can someone advise me on how to process this type in python with pyOpenSSL?
>
> Code:
>
>     pub = cert.get_pubkey()
>     pub_asn1 = OpenSSL.crypto.dump_publickey(
> OpenSSL.crypto.FILETYPE_ASN1, pub )
>
> Similarly I want to do the same for the Subject Public Key:
>
>         Subject Public Key Info:
>             Public Key Algorithm: id-ecPublicKey
>                 Public-Key: (256 bit)
>                 pub:
>                     <-snip->
>                 ASN1 OID: prime256v1
>                 NIST CURVE: P-256
>
>
> Does that make sense for what I am trying to do, and should I be able to
> do this with pyOpenSSL?
>
>
> Thanks
> Paul
>
>
>
>
>
>
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev at python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: D1B3 ADC0 E023 8CA6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20170420/5a7ef508/attachment.html>


More information about the Cryptography-dev mailing list