I have the following JSON:
{
"signed": {
"delegations": {
"keys": {
"blubb": {
"keytype": "rsa-x509",
"keyval": {
"private": null,
"public": "SomeOtherValue"
}
},
"d8674eb06f5aac8d003b2f309e302fd0a82414074acc9a626e0b447704f2a2b8": {
"keytype": "rsa-x509",
"keyval": {
"private": null,
"public": "SomeValue"
}
}
},
"roles": [{
"keyids": ["d8674eb06f5aac8d003b2f309e302fd0a82414074acc9a626e0b447704f2a2b8"],
"name": "targets/abc",
"paths": [""],
"threshold": 1
}, {
"keyids": ["blubb"],
"name": "targets/def",
"paths": [""],
"threshold": 1
}
]
}
}
}
I want to get the "SomeValue" for the key with the same name as the roles.keyids[0] where the corresponding name is "targets/abc".
I tried the following:
$.signed.delegations.keys[?($.signed.delegations.roles[?(@name == 'targets/abc')])].keyval.public
But that doesn't work.