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

Paul King paul at grumpypunk.com
Mon Apr 24 03:23:43 EDT 2017


Sorry. Being very stupid.

from cryptography.hazmat.primitives.asymmetric import ec
print isinstance(cert.public_key(), ec.EllipticCurvePublicKey)



> On 24 Apr 2017, at 08:21, Paul King via Cryptography-dev <cryptography-dev at python.org> wrote:
> 
> Thanks Alex.
> 
> I am now appreciating how good your documentation is!
> 
> I am struggling to do a test for the type of public key. In the documentation it shows an example for RSA but I am too stupid to get it to work.
> 
> 
>             print cert.public_key()
> <cryptography.hazmat.backends.openssl.ec._EllipticCurvePublicKey object at 0x102b5a3d0>
> 
>             print type( cert.public_key() )
> <class 'cryptography.hazmat.backends.openssl.ec._EllipticCurvePublicKey’>
> 
> How do I test for that?
> 
> 
> 
>> On 21 Apr 2017, at 02:07, Alex Gaynor <alex.gaynor at gmail.com <mailto:alex.gaynor at gmail.com>> wrote:
>> 
>> (Please reply to the full mailing lists)
>> 
>> https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey <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
>> 
> 
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev at python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20170424/6195cc3a/attachment.html>


More information about the Cryptography-dev mailing list