Skip to content

Commit 817440b

Browse files
committed
Working on documentation
1 parent 09e46a2 commit 817440b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

doc/keyhandling.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ RSA key from you could do like this::
7070
>>> rsa_key.public_key()
7171
<cryptography.hazmat.backends.openssl.rsa._RSAPublicKey object at 0x1036b1f60>
7272

73+
If you are dealing with Elliptic Curve keys the equivalent would be::
74+
75+
>>> from cryptojwt.jwk.ec import new_ec_key
76+
>>> ec_key = new_ec_key('P-256')
77+
>>> type(ec_key)
78+
<class 'cryptojwt.jwk.ec.ECKey'>
79+
>>> ec_key.has_private_key()
80+
True
81+
82+
and::
83+
84+
>>> from cryptojwt.jwk.ec import ECKey
85+
>>> ec_key = ECKey().load('ec-keypair.pem')
86+
>>> ec_key.has_private_key()
87+
True
88+
7389

7490

7591
.. _cryptography: https://cryptography.io/en/latest/

0 commit comments

Comments
 (0)