示例#1
0
def test_remove_sym():
    a = {"kty": "oct", "key": "supersecret", "use": "sig"}
    b = {"kty": "oct", "key": "secret", "use": "enc"}
    kb = KeyBundle([a, b])
    assert len(kb) == 2
    keys = kb.get('oct')
    kb.remove(keys[0])
    assert len(kb) == 1
示例#2
0
def test_remove_key_sym():
    a = {"kty": "oct", "key": "supersecret", "use": "sig"}
    b = {"kty": "oct", "key": "secret", "use": "enc"}
    kb = KeyBundle([a, b])
    assert len(kb) == 2
    keys = kb.get('oct')
    kb.remove(keys[0])
    assert len(kb) == 1

    # This should not work
    kb.remove_keys_by_type('rsa')
    # should still be one
    assert len(kb) == 1