Function libindy_sys::indy_prover_create_proof [−][src]
pub unsafe extern "C" fn indy_prover_create_proof(
command_handle: indy_handle_t,
wallet_handle: indy_handle_t,
proof_req_json: *const c_char,
requested_credentials_json: *const c_char,
master_secret_name: *const c_char,
schemas_json: *const c_char,
credential_defs_json: *const c_char,
rev_states_json: *const c_char,
cb: indy_str_cb
) -> indy_error_t
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.
#Params
wallet_handle: wallet handler (created by open_wallet).
command_handle: command handle to map callback to user context.
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
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
#Returns
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
#Errors Annoncreds* Common* Wallet*