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

Alex Gaynor alex.gaynor at gmail.com
Thu Apr 20 21:07:30 EDT 2017


(Please reply to the full mailing lists)

https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey
describes the methods that an EllipticCurvePublicKey has for exporting the
key, either to bytes or ot raw numbers.

Alex

On Thu, Apr 20, 2017 at 9:21 AM, Paul King <paul at grumpypunk.com> wrote:

>
>
> This all looks good, however I still struggle with the public key. Using
> cryptography only this time:
>
>
> >>> public_key = cert.public_key()
> >>> print public_key
> <cryptography.hazmat.backends.openssl.ec._EllipticCurvePublicKey object
> at 0x10fc6dfd0>
>
> So it has the public key, and correctly knows its elliptic curve.
>
> If I now want to break out all of the components/attributes of the public
> key object then how should I do it? What would be the best way? I guess I
> want SubjectPublicKeyInfo as well as the actual public key?
>
>
> The details I am hoping to find include:
>
>         Subject Public Key Info:
>>>             Public Key Algorithm: id-ecPublicKey
>>>                 Public-Key: (256 bit)
>>>                 pub:
>>>                     <-snip->
>>>                 ASN1 OID: prime256v1
>>>                 NIST CURVE: P-256
>>>
>>
>
>
>


-- 
"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/d0fa60e7/attachment.html>


More information about the Cryptography-dev mailing list