[−][src]Function indyrs::anoncreds::prover_get_credentials_for_proof_req
pub fn prover_get_credentials_for_proof_req(
wallet_handle: WalletHandle,
proof_request_json: &str
) -> Box<dyn Future<Item = String, Error = IndyError>>
Gets human readable credentials matching the given proof request.
NOTE: This method is deprecated because immediately returns all fetched credentials. Use <search_credentials_for_proof_req> to fetch records by small batches.
Arguments
wallet_handle
: wallet handle (created by Wallet::open_wallet).proof_request_json
: proof request json { "name": string, "version": string, "nonce": string, - a big number represented as a string (usegenerate_nonce
function to generate 80-bit number) "requested_attributes": { // set of requested attributes "<attr_referent>": <attr_info>, // see below ..., }, "requested_predicates": { // set of requested predicates "<predicate_referent>": <predicate_info>, // see below ..., }, "non_revoked": Optional<<non_revoc_interval>>, // see below, // If specified prover must proof non-revocation // for date in this interval for each attribute // (can be overridden on attribute level) }
where
attr_referent
: Proof-request local identifier of requested attribute
attr_info
: Describes requested attribute
{
"name": string, // attribute name, (case insensitive and ignore spaces)
"restrictions": Optional<filter_json>, // see above
"non_revoked": Optional<<non_revoc_interval>>, // see below,
// If specified prover must proof non-revocation
// for date in this interval this attribute
// (overrides proof level interval)
}
predicate_referent
: Proof-request local identifier of requested attribute predicate
predicate_info
: Describes requested attribute predicate
{
"name": attribute name, (case insensitive and ignore spaces)
"p_type": predicate type (Currently ">=" only)
"p_value": int predicate value
"restrictions": Optional<filter_json>, // see above
"non_revoked": Optional<<non_revoc_interval>>, // see below,
// If specified prover must proof non-revocation
// for date in this interval this attribute
// (overrides proof level interval)
}
non_revoc_interval
: Defines non-revocation interval
{
"from": Optional
Returns
credentials_json
: json with credentials for the given proof request. { "requested_attrs": { "<attr_referent>": [{ cred_info: <credential_info>, interval: Optional<non_revoc_interval> }], ..., }, "requested_predicates": { "requested_predicates": [{ cred_info: <credential_info>, timestamp: Optional}, { cred_info: <credential_2_info>, timestamp: Optional }], "requested_predicate_2_referent": [{ cred_info: <credential_2_info>, timestamp: Optional }] } }, where credential is { "referent": , "attrs": {"attr_name" : "attr_raw_value"}, "schema_id": string, "cred_def_id": string, "rev_reg_id": Optional , "cred_rev_id": Optional , }