0

我们目前有这样的证明请求:

{
    "name": "pr",
    "version": "1.0",
    "nonce": "0994650939",
    "requested_attributes": {
        "attr0_referent": {
            "name": "first_name",
            "restrictions": [{
                "cred_def_id": "credDefIdShareGlobal"
            }]
        }
    },
    "requested_predicates": {},
    "non_revoked": {}
}

如您所见,在限制字段上,现在我们只有一个限制。是否可以对同一属性有多个限制(如下例所示)?

{
    "name": "pr",
    "version": "1.0",
    "nonce": "0994650939",
    "requested_attributes": {
        "attr0_referent": {
            "name": "first_name",
            "restrictions": [{
                "cred_def_id": "credDefIdShareGlobal1"
            }, {
                "cred_def_id": "credDefIdShareGlobal2" // <-- Is this possible?
            }]
        }
    },
    "requested_predicates": {},
    "non_revoked": {}
}
4

1 回答 1

1

Well, to give some closure to this question, yeah. It works exactly like that.

To give more context, the attribute can be present in different schemas or different credentials and by adding the restrictions as shown they'll be dealt with as an "OR" so, the first one matching will be returned.

If you want to see an test example, I'll advise looking here: https://github.com/eduelias/indy-sdk/blob/MultipleReq/samples/nodejs/src/gettingStarted.js#L470

于 2019-12-11T12:13:44.493 回答