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")
Exemple #2
0
 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)
Exemple #4
0
 def serialize(item: key_issuer.KeyIssuer) -> str:
     """ Convert from KeyIssuer to JSON """
     return json.dumps(item.dump())