Skip to content
Guides

Enrollment

Before a device can attest, each installation of your client enrolls with Root Herald. Your server relays each step, your client keeps the attestation key blob enrollment wrote, and your server ends up holding an ID for the device.

Choose your client

How it works

Your secret API key stays on your server, so the device never talks to Root Herald directly. Instead, the device hands each step to your server, and your server passes it to Root Herald with relayEnroll and relayActivate. Nothing in those steps is meant for you to read: relay what you receive as it is.

Enrollment is per installation. Each one creates its own attestation key inside the chip, and nothing else: no key is released here. Two apps on one machine each enroll, and each gets its own key under the same device ID.

If the identity policy on your key doesn't accept the device, relayEnroll throws AdmissionRefusedError. That's a final answer for this device under this policy, so don't retry it; change the policy if you want the device in.

Keep the attestation key blob

On Windows and Linux, RootHeraldEnrollBegin writes the installation's attestation key as a blob the TPM wrapped. The SDK stores nothing: keep the blob in storage only your client can read, under DPAPI or in your app's data directory on Windows, in a file only your user can read on Linux. Load it for every attestation and every key you mint. On a Mac the key stays in the keychain and there is no blob.

Any process on the machine that holds the blob can use the key, so treat it as a credential. A copy on another machine does not load. Measured on an Intel PTT, the blob is 225 bytes with an ECC key and 513 with RSA; size buffers from the length the call returns.

When to enroll

Enroll whenever it fits your product: from an installer, on first run, or the first time an attestation tells you the installation isn't enrolled.

SignalDo
The client has no attestation key blob stored.Enroll first; attempt no attestation and mint no key.
Attest or MintKey returns RH_ERR_KEY_UNLOADABLE for the blob.Discard the blob, enroll, retry once. The SDK returns that code only when the TPM says the blob is dead; a transient TPM failure is a different code and a retry, never a re-enroll.
verify returns enrollmentRequired: true.Enroll, then get a fresh challenge: the nonce you verified is spent.
Attest or MintKey returns RH_ERR_INVALID_ARG with no blob passed.A bug in the call, not a reason to enroll: on a TPM platform the blob is required.

On iOS, attest throws .notEnrolled until markEnrolled has been called. Don't enroll again because a device failed its policy. A fail verdict is the policy's answer about that device, and enrolling it again doesn't change it.

The device ID

Enrollment ends with an ID for the device, and every verdict from that device carries the same ID as device.ueid. Keep it with whatever the device belongs to; it's how your server recognises the device later. The ID is unique to your account, so another Root Herald customer sees a different ID for the same machine. It survives an OS reinstall, a new attestation key, a second installation and a TPM clear, and carries no personal data. The device never holds it.

Deciding which devices are yours

Enrollment binds a chip, not a person: it doesn't need anyone signed in, and it can run from an installer. So if only your own machines should get in, decide that yourself. Give each sanctioned machine a one-time token, through MDM or a link you send, and accept the device only when its first passing attestation arrives with a token you haven't seen used.

server (Node)ts
app.post("/onboard", async (req, res) => {
  const { nonce, evidence, token } = req.body;

  const { device } = await rh.verify(evidence, { nonce });

  if (device.verdict !== "pass") {
    return res.sendStatus(403);
  }

  if (!(await redeemToken(token))) {
    return res.sendStatus(403);
  }

  await rememberDevice(device.ueid);

  res.sendStatus(204);
});