Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 2a2b74a

Browse files
committed
Merge branch 'master' of github.com:IdentityPython/oidcmsg
2 parents 8cdba9d + 450f9c7 commit 2a2b74a

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/oidcmsg/key_jar.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -884,27 +884,15 @@ def public_keys_keyjar(from_kj, origin, to_kj=None, receiver=''):
884884
:param from_kj: The KeyJar instance that contains the private keys
885885
:param origin: The owner ID
886886
:param to_kj: The KeyJar that is the receiver of the public keys
887-
:param receiver: The owner ID under which the publci keys should be stored
887+
:param receiver: The owner ID under which the public keys should be stored
888888
:return: The modified KeyJar instance
889-
890889
"""
890+
891891
if to_kj is None:
892892
to_kj = KeyJar()
893893

894-
for kb in from_kj[origin]:
895-
nkb = KeyBundle()
896-
for key in kb.keys():
897-
_ser = key.serialize()
898-
if isinstance(key, RSAKey):
899-
_key = RSAKey(**_ser)
900-
nkb.append(_key)
901-
elif isinstance(key, ECKey):
902-
_key = ECKey(**_ser)
903-
nkb.append(_key)
904-
elif isinstance(key, SYMKey):
905-
_key = SYMKey(**_ser)
906-
nkb.append(_key)
907-
to_kj.add_kb(receiver, nkb)
894+
_jwks = from_kj.export_jwks(origin)
895+
to_kj.import_jwks(_jwks, receiver)
908896

909897
return to_kj
910898

0 commit comments

Comments
 (0)