Getting a signing key identifier with curl

Send a request to the Raw Signature service to list the identifiers of the signing keys within the Virtual Token – for example:

$ curl -s -H "Authorization: $JWT" "$SIGNING_SERVICE_URL/raw/partitions/$PARTITION/tokens/$TOKEN/keys?quantity=10" | jq .
{
"result": {
"keys": [
{
"attributes": {},
"id": "cbfb2d79d86d92e3c07fabbd21c405783b4ef50f",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "337aeef5c25121ce7d5c9f1167387140bb60bccb",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "9b36fc631ac2cbff42f8b77927b838e27b12e68c",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "84d4cb379bc776f218142419afa23aadf56a362d",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "47257fe14fc41c6a8b9334d6caef80e01b2bedd6",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "600adc8742fe1e8b8816587ff97f3f43b2e30e10",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "13ba033a3a9a1e8d926ae504d3de5a45c8dd4610",
"keyParams": {
"type": "RSA2048"
}
},
{
"attributes": {},
"id": "5752d6b945024d344ec22ad73eb6bb5f9a018e67",
"keyParams": {
"type": "RSA2048"
}
}
],
"lastKey": "1701266768009109910"
}
}

Set the desired key identifier as an environment variable - for example:

$ export KEY_ID=cbeeb264a4aa3db78b8abedba6dae7fcf3548c29

Optionally, get detailed information on the signing key – for example:

$ curl -s -H "Authorization: $JWT" "$SIGNING_SERVICE_URL/raw/partitions/$PARTITION/tokens/$TOKEN/keys/$KEY_ID" | jq .
avid@myPKIHub:~/git/src/entrust.com/chinerd/sas-clients$ curl -s -H "Authorization: $JWT" "$SIGNING_SERVICE_URL/raw/partitions/$PARTITION/tokens/$TOKEN/keys/$KEY_ID" | jq .
{
"result": {
"attributes": {},
"value": {
"publicKeyObject": {
"keyType": "RSA2048",
"value": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCA................./QkQzGXRskrpLmJLmQIDAQAB"
}
},
"id": "cbfb2d79d86d92e3c07fabbd21c405783b4ef50f"
}
}