def test_no_suitable_keys():
    keytype = "RSA"
    alg = "RS256"
    msg = Message(a="foo", b="bar", c="tjoho")
    _jwt = msg.to_jwt(NEW_KEYJAR.get_signing_key(keytype, "", kid=NEW_KID),
                      alg)
    with pytest.raises(NoSuitableSigningKeys):
        Message().from_jwt(_jwt, KEYJAR)
Example #2
0
def test_no_suitable_keys():
    keytype = 'RSA'
    alg = 'RS256'
    msg = Message(a='foo', b='bar', c='tjoho')
    _jwt = msg.to_jwt(NEW_KEYJAR.get_signing_key(keytype, '', kid=NEW_KID),
                      alg)
    with pytest.raises(NoSuitableSigningKeys):
        Message().from_jwt(_jwt, KEYJAR)
def test_to_jwt(keytype, alg):
    msg = Message(a="foo", b="bar", c="tjoho")
    _jwt = msg.to_jwt(KEYJAR.get_signing_key(keytype, ""), alg)
    msg1 = Message().from_jwt(_jwt, KEYJAR)
    assert msg1 == msg
Example #4
0
def test_to_jwt(keytype, alg):
    msg = Message(a='foo', b='bar', c='tjoho')
    _jwt = msg.to_jwt(KEYJAR.get_signing_key(keytype, ''), alg)
    msg1 = Message().from_jwt(_jwt, KEYJAR)
    assert msg1 == msg