-
Hi, Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When creating the license key, whatever the license's "key" is set to during creation is what is signed and encoded into the final key. curl -X POST 'https://api.keygen.sh/v1/accounts/<account>/licenses' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u 'token:<token>' \
-d '{
"data": {
"type": "licenses",
"attributes": {
+ "key": "{ \"some\": \"data\", \"to\": [\"be\", \"signed\"] }"
},
"relationships": {
"policy": {
"data": { "type": "policies", "id": "<policy>" }
}
}
}
}' Would result in, for example: {
"data": {
"id": "ab5f7b72-ef6e-4fc6-856d-02d38e01c9a5",
"type": "licenses",
"attributes": {
"name": null,
+ "key": "key/eyAic29tZSI6ICJkYXRhIiwgInRvIjogWyJiZSIsICJzaWduZWQiXSB9.nesDnXvk9LCweEP5Dys6qJv5xWkHGIwcNX9PqUZ5cX7uwohKFmwF3Z3rV0ZJPJxxFFCoF3TcV9EfNGBM7G5aDw==",
"expiry": null,
...
},
"relationships": {
...
}
}
} Within the UI, set the license's "key" (which will change to "signing data" if the policy implements a cryptographic scheme). |
Beta Was this translation helpful? Give feedback.
When creating the license key, whatever the license's "key" is set to during creation is what is signed and encoded into the final key.
curl -X POST 'https://api.keygen.sh/v1/accounts/<account>/licenses' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -u 'token:<token>' \ -d '{ "data": { "type": "licenses", "attributes": { + "key": "{ \"some\": \"data\", \"to\": [\"be\", \"signed\"] }" }, "relationships": { "policy": { "data": { "type": "policies", "id": "<policy>" } } } } }'
Would result in, for example: