Skip to content

Commit 815d5b6

Browse files
authored
Merge pull request #89 from IdentityPython/docs
fix: RSA1_5 replaced by RSA-OAEP in doc examples
2 parents 4745a71 + 1d1d4da commit 815d5b6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

doc/jwe.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ There is a lower level way of doing the same, it will look like this::
4343
>>> from cryptojwt.jwk.rsa import import_private_rsa_key_from_file
4444
>>> from cryptojwt.jwe.jwe_rsa import JWE_RSA
4545

46-
>>> priv_key = import_private_rsa_key_from_file(KEY)
46+
>>> priv_key = import_private_rsa_key_from_file('certs/key.pem')
4747
>>> pub_key = priv_key.public_key()
4848
>>> plain = b'Now is the time for all good men to come to the aid of ...'
49-
>>> _rsa = JWE_RSA(plain, alg="RSA1_5", enc="A128CBC-HS256")
49+
>>> _rsa = JWE_RSA(plain, alg="RSA-OAEP", enc="A128CBC-HS256")
5050
>>> jwe = _rsa.encrypt(pub_key)
5151

5252
Here the key is an cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey
@@ -61,7 +61,7 @@ Decrypting using the encrypted message above.
6161
>>> from cryptojwt.jwe.jwe import factory
6262
>>> from cryptojwt.jwk.rsa import RSAKey
6363

64-
>>> _decryptor = factory(jwe, alg="RSA1_5", enc="A128CBC-HS256")
64+
>>> _decryptor = factory(jwe, alg="RSA-OAEP", enc="A128CBC-HS256")
6565
>>> _dkey = RSAKey(priv_key=priv_key)
6666
>>> msg = _decryptor.decrypt(jwe, [_dkey])
6767

src/cryptojwt/key_jar.py

-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def load_keys(self, issuer_id, jwks_uri="", jwks=None, replace=False):
318318
should be replace.
319319
:return: Dictionary with usage as key and keys as values
320320
"""
321-
322321
logger.debug("Initiating key bundle for issuer: %s" % issuer_id)
323322

324323
_issuer = self.return_issuer(issuer_id)

0 commit comments

Comments
 (0)