def test_copy(): desc = {"kty": "oct", "key": "highestsupersecret", "use": "sig"} kb = KeyBundle([desc]) assert len(kb.keys()) == 1 for k in kb.keys(): kb.mark_as_inactive(k.kid) desc = {"kty": "oct", "key": "highestsupersecret", "use": "enc"} kb.do_keys([desc]) kbc = kb.copy() assert len(kbc.keys()) == 2 assert len(kbc.active_keys()) == 1
def test_local_jwk_copy(): _path = full_path("jwk_private_key.json") kb = KeyBundle(source="file://{}".format(_path)) kb2 = kb.copy() assert kb2.source == kb.source