The device simulator is a Python package that generates cryptographically valid signed payloads indistinguishable from those produced by a real SentinelID USB dongle — without requiring physical hardware. It is sandbox-only; simulated device registrations are rejected by the live environment.

Install

pip install sentinelid-sim

Subcommands

register

Provision the simulated device with the sandbox API. Run this once per sandbox API key. The simulator generates a P-256 key pair and device identity on first run and persists them to ~/.sentinel_sim/identity.json.
sentinelid-sim register \
    --api-key sni_sandbox_YOUR_KEY \
    --publisher-id pub_acme
FlagDescription
--api-keyYour sandbox API key (sni_sandbox_…)
--publisher-idYour publisher ID (pub_…)
--base-urlOverride the API base URL (default: sandbox endpoint)

payload

Generate a signed DeviceCheckRequest payload. Pass the JSON output to your game server instead of calling the hardware client SDK.
sentinelid-sim payload \
    --publisher-id pub_acme \
    --game-id game_fps_01
Output:
{
  "device_id": "dvc_abc123",
  "publisher_id": "pub_acme",
  "game_id": "game_fps_01",
  "alg": "ES256",
  "payload_b64": "eyJ...",
  "sig_b64": "MEU..."
}

device-id

Print the persisted device ID for use in test assertions or ban calls.
sentinelid-sim device-id
# dvc_abc123

CI/CD Usage

The simulator’s identity persists at ~/.sentinel_sim/identity.json (Windows: %APPDATA%\sentinel_sim\identity.json). To avoid re-registering on every CI run:
  1. Run sentinelid-sim register locally once and capture identity.json.
  2. Store it as a CI secret or commit it to your test fixtures.
  3. Place it at the expected path before running tests:
mkdir -p ~/.sentinel_sim
echo "$SENTINEL_SIM_IDENTITY" > ~/.sentinel_sim/identity.json

sentinelid-sim payload --publisher-id pub_acme --game-id game_fps_01
Delete identity.json to generate a fresh device identity. The old device ID will remain registered in the sandbox — create a new sandbox API key if you need a clean slate.