def METHOD_NAME(enrollment_session, target, artifact_version_pk):
    if not isinstance(artifact_version_pk, str):
        artifact_version_pk = str(artifact_version_pk)
    payload = {"avpk": artifact_version_pk,
               "esm": enrollment_session._meta.model_name,
               "espk": enrollment_session.pk}
    if target.enrolled_user:
        payload["eupk"] = target.enrolled_user.pk
    return signing.dumps(payload, salt="zentral_mdm_legacy_profile")