Skip to content

fix: RSA1_5 replaced by RSA-OAEP in doc examples #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/jwe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ There is a lower level way of doing the same, it will look like this::
>>> from cryptojwt.jwk.rsa import import_private_rsa_key_from_file
>>> from cryptojwt.jwe.jwe_rsa import JWE_RSA

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

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

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

Expand Down
1 change: 0 additions & 1 deletion src/cryptojwt/key_jar.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ def load_keys(self, issuer_id, jwks_uri="", jwks=None, replace=False):
should be replace.
:return: Dictionary with usage as key and keys as values
"""

logger.debug("Initiating key bundle for issuer: %s" % issuer_id)

_issuer = self.return_issuer(issuer_id)
Expand Down