You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 2. Create a key authorized only for this machine
33
36
result = sdk.create_key({
34
37
'productId': product_id,
35
-
'allowedHosts': ['machine-a']
38
+
'allowedHosts': [host_id]
36
39
})
37
40
38
41
if result and'key'in result:
39
-
key = result['key']
40
-
# ...
42
+
print(f"Created Key: {result['key']}")
41
43
```
42
44
43
-
## Error Handling
44
-
All SDK methods return a dictionary. If an API call fails, the SDK raises a `KeyMintApiError` exception with `message`, `code`, and `status` attributes.
45
+
## Machine Identity
46
+
Keymint provides utilities to uniquely identify machines for node-locking:
47
+
48
+
-`identity.get_or_create_installation_id()`: **Recommended.** Generates a stable UUID anchored to hardware and persists it to `~/.keymint/installation-id`.
49
+
-`identity.get_machine_id()`: Generates a SHA-256 fingerprint based on BIOS UUID, OS machine ID, and MAC address.
0 commit comments