def METHOD_NAME(alice, bob, mallory):
    now = DateTime.now()
    certif = UserCertificate(
        author=alice.device_id,
        timestamp=now,
        user_id=bob.user_id,
        human_handle=bob.human_handle,
        public_key=bob.public_key,
        profile=UserProfile.ADMIN,
    ).dump_and_sign(alice.signing_key)
    assert isinstance(certif, bytes)
    unsecure = UserCertificate.unsecure_load(certif)
    assert isinstance(unsecure, UserCertificate)
    assert unsecure.user_id == bob.user_id
    assert unsecure.public_key == bob.public_key
    assert unsecure.timestamp == now
    assert unsecure.author == alice.device_id
    assert unsecure.profile == UserProfile.ADMIN
    verified = UserCertificate.verify_and_load(
        certif, author_verify_key=alice.verify_key, expected_author=alice.device_id
    )
    assert verified == unsecure
    with pytest.raises(DataError) as exc:
        UserCertificate.verify_and_load(
            certif, author_verify_key=alice.verify_key, expected_author=mallory.device_id
        )
    assert str(exc.value) == "Invalid author: expected `mallory@dev1`, got `alice@dev1`"
    with pytest.raises(DataError) as exc:
        UserCertificate.verify_and_load(
            certif, author_verify_key=mallory.verify_key, expected_author=alice.device_id
        )
    assert str(exc.value) == "Invalid signature"
    with pytest.raises(DataError) as exc:
        UserCertificate.verify_and_load(
            certif,
            author_verify_key=alice.verify_key,
            expected_author=alice.device_id,
            expected_user=mallory.user_id,
        )
    assert str(exc.value) == "Invalid user ID: expected `mallory`, got `bob`"