Struct indy::anoncreds::Prover

source ·
pub struct Prover {}

Implementations

Creates a master secret with a given id and stores it in the wallet. The id must be unique.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • master_secret_id: (optional, if not present random one will be generated) new master id
Returns
  • out_master_secret_id - Id of generated master secret

Creates a master secret with a given id and stores it in the wallet. The id must be unique.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • master_secret_id: (optional, if not present random one will be generated) new master id
  • timeout - the maximum time this function waits for a response
Returns
  • out_master_secret_id - Id of generated master secret

Creates a master secret with a given id and stores it in the wallet. The id must be unique.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • master_secret_id: (optional, if not present random one will be generated) new master id
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Gets human readable credential by the given id.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • cred_id: Identifier by which requested credential is stored in the wallet
Returns
  • credential_json - { “referent”: string, // cred_id in the wallet “attrs”: {“key1”:“raw_value1”, “key2”:“raw_value2”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional }

Gets human readable credential by the given id.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • cred_id: Identifier by which requested credential is stored in the wallet
  • timeout - the maximum time this function waits for a response
Returns
  • credential_json - { “referent”: string, // cred_id in the wallet “attrs”: {“key1”:“raw_value1”, “key2”:“raw_value2”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional }

Gets human readable credential by the given id.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • cred_id: Identifier by which requested credential is stored in the wallet
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Creates a credential request for the given credential offer.

The method creates a blinded master secret for a master secret identified by a provided name. The master secret identified by the name must be already stored in the secure wallet (see Prover::create_master_secret) The blinded master secret is a part of the credential request.

Arguments
  • wallet_handle: wallet handler (created by open_wallet)
  • prover_did: a DID of the prover
  • cred_offer_json: credential offer as a json containing information about the issuer and a credential
  • cred_def_json: credential definition json related to <cred_def_id> in <cred_offer_json>
  • master_secret_id: the id of the master secret stored in the wallet
Returns
  • cred_req_json: Credential request json for creation of credential by Issuer { “prover_did” : string, “cred_def_id” : string, // Fields below can depend on Cred Def type “blinded_ms” : <blinded_master_secret>, “blinded_ms_correctness_proof” : <blinded_ms_correctness_proof>, “nonce”: string }
  • cred_req_metadata_json: Credential request metadata json for further processing of received form Issuer credential.

Creates a credential request for the given credential offer.

The method creates a blinded master secret for a master secret identified by a provided name. The master secret identified by the name must be already stored in the secure wallet (see Prover::create_master_secret) The blinded master secret is a part of the credential request.

Arguments
  • wallet_handle: wallet handler (created by open_wallet)
  • prover_did: a DID of the prover
  • cred_offer_json: credential offer as a json containing information about the issuer and a credential
  • cred_def_json: credential definition json related to <cred_def_id> in <cred_offer_json>
  • master_secret_id: the id of the master secret stored in the wallet
  • timeout - the maximum time this function waits for a response
Returns
  • cred_req_json: Credential request json for creation of credential by Issuer { “prover_did” : string, “cred_def_id” : string, // Fields below can depend on Cred Def type “blinded_ms” : <blinded_master_secret>, “blinded_ms_correctness_proof” : <blinded_ms_correctness_proof>, “nonce”: string }
  • cred_req_metadata_json: Credential request metadata json for further processing of received form Issuer credential.

Creates a credential request for the given credential offer.

The method creates a blinded master secret for a master secret identified by a provided name. The master secret identified by the name must be already stored in the secure wallet (see Prover::create_master_secret) The blinded master secret is a part of the credential request.

Arguments
  • wallet_handle: wallet handler (created by open_wallet)
  • prover_did: a DID of the prover
  • cred_offer_json: credential offer as a json containing information about the issuer and a credential
  • cred_def_json: credential definition json related to <cred_def_id> in <cred_offer_json>
  • master_secret_id: the id of the master secret stored in the wallet
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Check credential provided by Issuer for the given credential request, updates the credential by a master secret and stores in a secure wallet.

To support efficient and flexible search the following tags will be created for stored credential: { “schema_id”: , “schema_issuer_did”: , “schema_name”: , “schema_version”: , “issuer_did”: , “cred_def_id”: , “rev_reg_id”: , // “None” as string if not present // for every attribute in “attr::::marker”: “1”, “attr::::value”: , }

Arguments
  • wallet_handle: wallet handler (created by open_wallet).
  • cred_id: (optional, default is a random one) identifier by which credential will be stored in the wallet
  • cred_req_metadata_json: a credential request metadata created by Prover::create_credential_req
  • cred_json: credential json received from issuer
  • cred_def_json: credential definition json related to <cred_def_id> in <cred_json>
  • rev_reg_def_json: revocation registry definition json related to <rev_reg_def_id> in <cred_json>
Returns
  • out_cred_id - identifier by which credential is stored in the wallet

Check credential provided by Issuer for the given credential request, updates the credential by a master secret and stores in a secure wallet.

To support efficient and flexible search the following tags will be created for stored credential: { “schema_id”: , “schema_issuer_did”: , “schema_name”: , “schema_version”: , “issuer_did”: , “cred_def_id”: , “rev_reg_id”: , // “None” as string if not present // for every attribute in “attr::::marker”: “1”, “attr::::value”: , }

Arguments
  • wallet_handle: wallet handler (created by open_wallet).
  • cred_id: (optional, default is a random one) identifier by which credential will be stored in the wallet
  • cred_req_metadata_json: a credential request metadata created by Prover::create_credential_req
  • cred_json: credential json received from issuer
  • cred_def_json: credential definition json related to <cred_def_id> in <cred_json>
  • rev_reg_def_json: revocation registry definition json related to <rev_reg_def_id> in <cred_json>
  • timeout - the maximum time this function waits for a response
Returns
  • out_cred_id - identifier by which credential is stored in the wallet

Check credential provided by Issuer for the given credential request, updates the credential by a master secret and stores in a secure wallet.

To support efficient and flexible search the following tags will be created for stored credential: { “schema_id”: , “schema_issuer_did”: , “schema_name”: , “schema_version”: , “issuer_did”: , “cred_def_id”: , “rev_reg_id”: , // “None” as string if not present // for every attribute in “attr::::marker”: “1”, “attr::::value”: , }

Arguments
  • wallet_handle: wallet handler (created by open_wallet).
  • cred_id: (optional, default is a random one) identifier by which credential will be stored in the wallet
  • cred_req_metadata_json: a credential request metadata created by Prover::create_credential_req
  • cred_json: credential json received from issuer
  • cred_def_json: credential definition json related to <cred_def_id> in <cred_json>
  • rev_reg_def_json: revocation registry definition json related to <rev_reg_def_id> in <cred_json>
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Gets human readable credentials according to the filter. If filter is NULL, then all credentials are returned. Credentials can be filtered by Issuer, credential_def and/or Schema.

Arguments
  • wallet_handle: wallet handler (created by open_wallet).
  • filter_json: filter for credentials { “schema_id”: string, (Optional) “schema_issuer_did”: string, (Optional) “schema_name”: string, (Optional) “schema_version”: string, (Optional) “issuer_did”: string, (Optional) “cred_def_id”: string, (Optional) }
Returns
  • credentials_json - [{ “referent”: string, // cred_id in the wallet “attrs”: {“key1”:“raw_value1”, “key2”:“raw_value2”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional }]

Gets human readable credentials according to the filter. If filter is NULL, then all credentials are returned. Credentials can be filtered by Issuer, credential_def and/or Schema.

Arguments
  • wallet_handle: wallet handler (created by open_wallet).
  • filter_json: filter for credentials { “schema_id”: string, (Optional) “schema_issuer_did”: string, (Optional) “schema_name”: string, (Optional) “schema_version”: string, (Optional) “issuer_did”: string, (Optional) “cred_def_id”: string, (Optional) }
  • timeout - the maximum time this function waits for a response
Returns
  • credentials_json - [{ “referent”: string, // cred_id in the wallet “attrs”: {“key1”:“raw_value1”, “key2”:“raw_value2”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional }]

Gets human readable credentials according to the filter. If filter is NULL, then all credentials are returned. Credentials can be filtered by Issuer, credential_def and/or Schema.

Arguments
  • wallet_handle: wallet handler (created by open_wallet).
  • filter_json: filter for credentials { “schema_id”: string, (Optional) “schema_issuer_did”: string, (Optional) “schema_name”: string, (Optional) “schema_version”: string, (Optional) “issuer_did”: string, (Optional) “cred_def_id”: string, (Optional) }
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Search for credentials stored in wallet. Credentials can be filtered by tags created during saving of credential.

Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with Prover::fetch_credentials).

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • query_json: Wql query filter for credentials searching based on tags. where query: indy-sdk/doc/design/011-wallet-query-language/README.md
Returns
  • search_handle: Search handle that can be used later to fetch records by small batches (with Prover::fetch_credentials)
  • total_count: Total count of records

Search for credentials stored in wallet. Credentials can be filtered by tags created during saving of credential.

Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with Prover::fetch_credentials).

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • query_json: Wql query filter for credentials searching based on tags. where query: indy-sdk/doc/design/011-wallet-query-language/README.md
  • timeout - the maximum time this function waits for a response
Returns
  • search_handle: Search handle that can be used later to fetch records by small batches (with Prover::fetch_credentials)
  • total_count: Total count of records

Search for credentials stored in wallet. Credentials can be filtered by tags created during saving of credential.

Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with Prover::fetch_credentials).

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • query_json: Wql query filter for credentials searching based on tags. where query: indy-sdk/doc/design/011-wallet-query-language/README.md
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Fetch next credentials for search.

Arguments
  • search_handle: Search handle (created by Prover::search_credentials)
  • count: Count of credentials to fetch
Returns
  • credentials_json: List of human readable credentials: [{ “referent”: string, // cred_id in the wallet “attrs”: {“key1”:“raw_value1”, “key2”:“raw_value2”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional }]

Fetch next credentials for search.

Arguments
  • search_handle: Search handle (created by Prover::search_credentials)
  • count: Count of credentials to fetch
  • timeout - the maximum time this function waits for a response
Returns
  • credentials_json: List of human readable credentials: [{ “referent”: string, // cred_id in the wallet “attrs”: {“key1”:“raw_value1”, “key2”:“raw_value2”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional }]

Fetch next credentials for search.

Arguments
  • search_handle: Search handle (created by Prover::search_credentials)
  • count: Count of credentials to fetch
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Close credentials search (make search handle invalid)

Arguments
  • search_handle: Search handle (created by Prover::search_credentials)

Close credentials search (make search handle invalid)

Arguments
  • search_handle: Search handle (created by Prover::search_credentials)
  • timeout - the maximum time this function waits for a response

Close credentials search (make search handle invalid)

Arguments
  • search_handle: Search handle (created by Prover::search_credentials)
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Gets human readable credentials matching the given proof request.

NOTE: This method is deprecated because immediately returns all fetched credentials. Use Prover::search_credentials_for_proof_req to fetch records by small batches.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

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, }

Gets human readable credentials matching the given proof request.

NOTE: This method is deprecated because immediately returns all fetched credentials. Use Prover::search_credentials_for_proof_req to fetch records by small batches.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • timeout - the maximum time this function waits for a response

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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

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, }

Gets human readable credentials matching the given proof request.

NOTE: This method is deprecated because immediately returns all fetched credentials. Use Prover::search_credentials_for_proof_req to fetch records by small batches.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • closure - the closure that is called when finished

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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Search for credentials matching the given proof request.

Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with Prover::fetch_credentials_for_proof_req).

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • extra_query_json: (Optional) List of extra queries that will be applied to correspondent attribute/predicate: { “<attr_referent>”: , “<predicate_referent>”: , } where wql query: indy-sdk/doc/design/011-wallet-query-language/README.md

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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • search_handle: Search handle that can be used later to fetch records by small batches (with Prover::fetch_credentials_for_proof_req)

Search for credentials matching the given proof request.

Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with Prover::fetch_credentials_for_proof_req).

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • extra_query_json: (Optional) List of extra queries that will be applied to correspondent attribute/predicate: { “<attr_referent>”: , “<predicate_referent>”: , } where wql query: indy-sdk/doc/design/011-wallet-query-language/README.md
  • timeout - the maximum time this function waits for a response

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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • search_handle: Search handle that can be used later to fetch records by small batches (with Prover::fetch_credentials_for_proof_req)

Search for credentials matching the given proof request.

Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with Prover::fetch_credentials_for_proof_req).

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • extra_query_json: (Optional) List of extra queries that will be applied to correspondent attribute/predicate: { “<attr_referent>”: , “<predicate_referent>”: , } where wql query: indy-sdk/doc/design/011-wallet-query-language/README.md
  • closure - the closure that is called when finished

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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Fetch next credentials for the requested item using proof request search handle (created by Prover::search_credentials_for_proof_req).

Arguments
  • search_handle: Search handle (created by Prover::search_credentials_for_proof_req)
  • item_referent: Referent of attribute/predicate in the proof request
  • count: Count of credentials to fetch
Returns
  • credentials_json: List of credentials for the given proof request. [{ cred_info: <credential_info>, interval: Optional<non_revoc_interval> }] where credential_info: { “referent”: , “attrs”: {“attr_name” : “attr_raw_value”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional, } non_revoc_interval: { “from”: Optional, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending } NOTE: The list of length less than the requested count means that search iterator correspondent to the requested <item_referent> is completed.

Fetch next credentials for the requested item using proof request search handle (created by Prover::search_credentials_for_proof_req).

Arguments
  • search_handle: Search handle (created by Prover::search_credentials_for_proof_req)
  • item_referent: Referent of attribute/predicate in the proof request
  • count: Count of credentials to fetch
  • timeout - the maximum time this function waits for a response
Returns
  • credentials_json: List of credentials for the given proof request. [{ cred_info: <credential_info>, interval: Optional<non_revoc_interval> }] where credential_info: { “referent”: , “attrs”: {“attr_name” : “attr_raw_value”}, “schema_id”: string, “cred_def_id”: string, “rev_reg_id”: Optional, “cred_rev_id”: Optional, } non_revoc_interval: { “from”: Optional, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending } NOTE: The list of length less than the requested count means that search iterator correspondent to the requested <item_referent> is completed.

Fetch next credentials for the requested item using proof request search handle (created by Prover::search_credentials_for_proof_req).

Arguments
  • search_handle: Search handle (created by Prover::search_credentials_for_proof_req)
  • item_referent: Referent of attribute/predicate in the proof request
  • count: Count of credentials to fetch
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Close credentials search for proof request (make search handle invalid)

Arguments
  • search_handle: Search handle (created by Prover::search_credentials_for_proof_req)

Close credentials search for proof request (make search handle invalid)

Arguments
  • search_handle: Search handle (created by Prover::search_credentials_for_proof_req)
  • timeout - the maximum time this function waits for a response

Close credentials search for proof request (make search handle invalid)

Arguments
  • search_handle: Search handle (created by Prover::search_credentials_for_proof_req)
  • closure - the closure that is called when finished
Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Creates a proof according to the given proof request Either a corresponding credential with optionally revealed attributes or self-attested attribute must be provided for each requested attribute (see indy_prover_get_credentials_for_pool_req). A proof request may request multiple credentials from different schemas and different issuers. All required schemas, public keys and revocation registries must be provided. The proof request also contains nonce. The proof contains either proof or self-attested attribute value for each requested attribute.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • requested_credentials_json: either a credential or self-attested attribute for each requested attribute { “self_attested_attributes”: { “self_attested_attribute_referent”: string }, “requested_attributes”: { “requested_attribute_referent_1”: {“cred_id”: string, “timestamp”: Optional, revealed: }}, “requested_attribute_referent_2”: {“cred_id”: string, “timestamp”: Optional, revealed: }} }, “requested_predicates”: { “requested_predicates_referent_1”: {“cred_id”: string, “timestamp”: Optional }}, } }
  • master_secret_id: the id of the master secret stored in the wallet
  • schemas_json: all schemas json participating in the proof request { <schema1_id>: <schema1_json>, <schema2_id>: <schema2_json>, <schema3_id>: <schema3_json>, }
  • credential_defs_json: all credential definitions json participating in the proof request { “cred_def1_id”: <credential_def1_json>, “cred_def2_id”: <credential_def2_json>, “cred_def3_id”: <credential_def3_json>, }
  • rev_states_json: all revocation states json participating in the proof request { “rev_reg_def1_id”: { “timestamp1”: <rev_state1>, “timestamp2”: <rev_state2>, }, “rev_reg_def2_id”: { “timestamp3”: <rev_state3> }, “rev_reg_def3_id”: { “timestamp4”: <rev_state4> }, }

where where wql query: indy-sdk/doc/design/011-wallet-query-language/README.md 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, “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”: predicate value “restrictions”: Optional, “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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • proof_json - proof json For each requested attribute either a proof (with optionally revealed attribute value) or self-attested attribute value is provided. Each proof is associated with a credential and corresponding schema_id, cred_def_id, rev_reg_id and timestamp. There is also aggregated proof part common for all credential proofs. { “requested”: { “revealed_attrs”: { “requested_attr1_id”: {sub_proof_index: number, raw: string, encoded: string}, “requested_attr4_id”: {sub_proof_index: number: string, encoded: string}, }, “unrevealed_attrs”: { “requested_attr3_id”: {sub_proof_index: number} }, “self_attested_attrs”: { “requested_attr2_id”: self_attested_value, }, “requested_predicates”: { “requested_predicate_1_referent”: {sub_proof_index: int}, “requested_predicate_2_referent”: {sub_proof_index: int}, } } “proof”: { “proofs”: [ <credential_proof>, <credential_proof>, <credential_proof> ], “aggregated_proof”: <aggregated_proof> } “identifiers”: [{schema_id, cred_def_id, Optional<rev_reg_id>, Optional}] }

Creates a proof according to the given proof request Either a corresponding credential with optionally revealed attributes or self-attested attribute must be provided for each requested attribute (see indy_prover_get_credentials_for_pool_req). A proof request may request multiple credentials from different schemas and different issuers. All required schemas, public keys and revocation registries must be provided. The proof request also contains nonce. The proof contains either proof or self-attested attribute value for each requested attribute.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • requested_credentials_json: either a credential or self-attested attribute for each requested attribute { “self_attested_attributes”: { “self_attested_attribute_referent”: string }, “requested_attributes”: { “requested_attribute_referent_1”: {“cred_id”: string, “timestamp”: Optional, revealed: }}, “requested_attribute_referent_2”: {“cred_id”: string, “timestamp”: Optional, revealed: }} }, “requested_predicates”: { “requested_predicates_referent_1”: {“cred_id”: string, “timestamp”: Optional }}, } }
  • master_secret_id: the id of the master secret stored in the wallet
  • schemas_json: all schemas json participating in the proof request { <schema1_id>: <schema1_json>, <schema2_id>: <schema2_json>, <schema3_id>: <schema3_json>, }
  • credential_defs_json: all credential definitions json participating in the proof request { “cred_def1_id”: <credential_def1_json>, “cred_def2_id”: <credential_def2_json>, “cred_def3_id”: <credential_def3_json>, }
  • rev_states_json: all revocation states json participating in the proof request { “rev_reg_def1_id”: { “timestamp1”: <rev_state1>, “timestamp2”: <rev_state2>, }, “rev_reg_def2_id”: { “timestamp3”: <rev_state3> }, “rev_reg_def3_id”: { “timestamp4”: <rev_state4> }, }
  • timeout - the maximum time this function waits for a response

where where wql query: indy-sdk/doc/design/011-wallet-query-language/README.md 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, “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”: predicate value “restrictions”: Optional, “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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • proof_json - proof json For each requested attribute either a proof (with optionally revealed attribute value) or self-attested attribute value is provided. Each proof is associated with a credential and corresponding schema_id, cred_def_id, rev_reg_id and timestamp. There is also aggregated proof part common for all credential proofs. { “requested”: { “revealed_attrs”: { “requested_attr1_id”: {sub_proof_index: number, raw: string, encoded: string}, “requested_attr4_id”: {sub_proof_index: number: string, encoded: string}, }, “unrevealed_attrs”: { “requested_attr3_id”: {sub_proof_index: number} }, “self_attested_attrs”: { “requested_attr2_id”: self_attested_value, }, “requested_predicates”: { “requested_predicate_1_referent”: {sub_proof_index: int}, “requested_predicate_2_referent”: {sub_proof_index: int}, } } “proof”: { “proofs”: [ <credential_proof>, <credential_proof>, <credential_proof> ], “aggregated_proof”: <aggregated_proof> } “identifiers”: [{schema_id, cred_def_id, Optional<rev_reg_id>, Optional}] }

Creates a proof according to the given proof request Either a corresponding credential with optionally revealed attributes or self-attested attribute must be provided for each requested attribute (see indy_prover_get_credentials_for_pool_req). A proof request may request multiple credentials from different schemas and different issuers. All required schemas, public keys and revocation registries must be provided. The proof request also contains nonce. The proof contains either proof or self-attested attribute value for each requested attribute.

Arguments
  • wallet_handle: wallet handler (created by Wallet::open_wallet).
  • proof_request_json: proof request json { “name”: string, “version”: string, “nonce”: string, “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) }
  • requested_credentials_json: either a credential or self-attested attribute for each requested attribute { “self_attested_attributes”: { “self_attested_attribute_referent”: string }, “requested_attributes”: { “requested_attribute_referent_1”: {“cred_id”: string, “timestamp”: Optional, revealed: }}, “requested_attribute_referent_2”: {“cred_id”: string, “timestamp”: Optional, revealed: }} }, “requested_predicates”: { “requested_predicates_referent_1”: {“cred_id”: string, “timestamp”: Optional }}, } }
  • master_secret_id: the id of the master secret stored in the wallet
  • schemas_json: all schemas json participating in the proof request { <schema1_id>: <schema1_json>, <schema2_id>: <schema2_json>, <schema3_id>: <schema3_json>, }
  • credential_defs_json: all credential definitions json participating in the proof request { “cred_def1_id”: <credential_def1_json>, “cred_def2_id”: <credential_def2_json>, “cred_def3_id”: <credential_def3_json>, }
  • rev_states_json: all revocation states json participating in the proof request { “rev_reg_def1_id”: { “timestamp1”: <rev_state1>, “timestamp2”: <rev_state2>, }, “rev_reg_def2_id”: { “timestamp3”: <rev_state3> }, “rev_reg_def3_id”: { “timestamp4”: <rev_state4> }, }
  • closure - the closure that is called when finished

where where wql query: indy-sdk/doc/design/011-wallet-query-language/README.md 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, “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”: predicate value “restrictions”: Optional, “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, // timestamp of interval beginning “to”: Optional, // timestamp of interval ending }

Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.