def test_dump(): issuer = KeyIssuer() issuer.add_kb(KeyBundle(JWK2["keys"])) res = issuer.dump() nkj = KeyIssuer().load(res) assert nkj.get("sig", "rsa", kid="kriMPdmBvx68skT8-mPAB3BseeA") assert nkj.get("sig", "rsa", kid="MnC_VZcATfM5pOYiJHMba9goEKY")
def serialize(item: key_issuer.KeyIssuer) -> str: """Convert from KeyIssuer to JSON""" return json.dumps(item.dump(exclude_attributes=["keybundle_cls"]))
def test_dump_json(): issuer = KeyIssuer() issuer.add_kb(KeyBundle(JWK2["keys"])) res = issuer.dump() assert json.dumps(res)
def serialize(item: key_issuer.KeyIssuer) -> str: """ Convert from KeyIssuer to JSON """ return json.dumps(item.dump())