> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/nitride/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/nitride/tutorials/attestation-blueprint-1/create-or-update-identities.md). Agents can also search and read this documentation through its [MCP server](https://docs.enclaive.cloud/nitride/~gitbook/mcp).

# Create or update identities

Learn to create or update identities

Identities in this system are versioned by their creation timestamp. For verification purposes, the most recently created identity for a given name is always used. This design allows you to easily update an identity when it becomes outdated without needing to change your policy or the attestation configuration itself.

Create a new identity  named `test-local` of the type `firmware` :

1. Create a file named `firmware.json`  with these content:

```
{
  "type": "firmware",
  "name": "test-local",
  "values": {
    "measurement": "eb5c02d3ba319e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea"
  }
}
```

2. Use the `vhsm nitride identity create @firmware.json`

**Output is similar to**:

```
Key        Value
---        -----
created    1749465559
name       test-local
type       firmware
values     map[measurement:eb5c02d3ba319e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea]
```

#### Other methods:

{% tabs %}
{% tab title="vHSM CLI" %}

```
vhsm write auth/ratls/identities - <<'EOF'
{
  "type": "firmware",
  "name": "test-local",
  "values": {
    "measurement": "eb5c02d3ba319e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea"
  }
}
EOF
```

{% endtab %}

{% tab title="cURL" %}
This method is more universal and directly interacts with the API endpoint. Remember to replace `hvs.XXXXX` with your valid authentication token.

```bash
curl -H "X-Vault-Token: hvs.XXXXX" \
    http://localhost:8200/v1/auth/ratls/identities \
    --data '{"type":"firmware","name":"test-local","values":{"measurement":"eb5c02d3ba319e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea"}}'9e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea"}}'
```

{% endtab %}
{% endtabs %}

The output is similar to:

{% tabs %}
{% tab title="vHSM CLI" %}

```
Key        Value
---        -----
created    1749465559
name       test-local
type       firmware
values     map[measurement:eb5c02d3ba319e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea]

```

{% endtab %}

{% tab title="cURL" %}

```json
{
  "request_id": "97074d26-615c-a20d-ff88-8b14d2a75b93",
  "lease_id": "",
  "renewable": false,
  "lease_duration": 0,
  "data": {
    "created": 1734559789,
    "name": "test-local",
    "type": "firmware",
    "values": {
      "measurement": "eb5c02d3ba319e65218994fc47925cf8a5e9a433081c44d4d989434f15a7c6d715d302401b3147da04e49abc99e50aea"
    }
  },
  "wrap_info": null,
  "warnings": null,
  "auth": null
}
```

{% endtab %}
{% endtabs %}

#### Possible Error Response:

If there is an. issue with the request body, such as unknown identity type, you might receive an error:

```json
{
  "errors": [
    "failed parsing: unknown type"
  ]
}
```

**Description of `values` field content by Identity type:**

The content you put in the `values` field within the request body depends on the `type` of the identity you are creating or updating.&#x20;

| Identity Type | Description of values Content                                                                                                                                                                                                                                                                                                                                                                    |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `platform`    | It would typically contain platform-specific attestation data.                                                                                                                                                                                                                                                                                                                                   |
| `firmware`    | <p>Used for firmware-level identities.<br>- <code>measurement</code>: The OVMF/UEFI measurement (e.g., a SHA256 hash).<br>- <code>firmware</code>: The firmware version of the platform. Supports <a href="https://semver.org/">semantic versioning</a> constraints like <code>>= 1.55.22</code>.<br>- <code>root\_of\_trust</code>: The certificate chain used in the verification process.</p> |
| `workload`    | <p>Used for workload-level identities.<br>- <code>hash</code>: A human-readable name of the hash function used (e.g., "sha256").<br>- <code>pcrs</code>: A dictionary mapping integer PCR (Platform Configuration Register) indices to their encoded PCR values (strings).</p>                                                                                                                   |
| `metadata`    | More details about the identity.                                                                                                                                                                                                                                                                                                                                                                 |
