pub struct Verifier {}
Implementations
sourceimpl Verifier
impl Verifier
sourcepub fn verify_proof(
proof_request_json: &str,
proof_json: &str,
schemas_json: &str,
credential_defs_json: &str,
rev_reg_defs_json: &str,
rev_regs_json: &str
) -> Result<bool, ErrorCode>
pub fn verify_proof(
proof_request_json: &str,
proof_json: &str,
schemas_json: &str,
credential_defs_json: &str,
rev_reg_defs_json: &str,
rev_regs_json: &str
) -> Result<bool, ErrorCode>
Verifies a proof (of multiple credential). All required schemas, public keys and revocation registries must be provided.
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) }proof_json
: created for request proof json { “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}] } schemas_json
: all schema jsons participating in the proof { <schema1_id>: <schema1_json>, <schema2_id>: <schema2_json>, <schema3_id>: <schema3_json>, }credential_defs_json
: all credential definitions json participating in the proof { “cred_def1_id”: <credential_def1_json>, “cred_def2_id”: <credential_def2_json>, “cred_def3_id”: <credential_def3_json>, }rev_reg_defs_json
: all revocation registry definitions json participating in the proof { “rev_reg_def1_id”: <rev_reg_def1_json>, “rev_reg_def2_id”: <rev_reg_def2_json>, “rev_reg_def3_id”: <rev_reg_def3_json>, }rev_regs_json
: all revocation registries json participating in the proof { “rev_reg_def1_id”: { “timestamp1”: <rev_reg1>, “timestamp2”: <rev_reg2>, }, “rev_reg_def2_id”: { “timestamp3”: <rev_reg3> }, “rev_reg_def3_id”: { “timestamp4”: <rev_reg4> }, }
Returns
valid
: true - if signature is valid, false - otherwise
sourcepub fn verify_proof_timeout(
proof_request_json: &str,
proof_json: &str,
schemas_json: &str,
credential_defs_json: &str,
rev_reg_defs_json: &str,
rev_regs_json: &str,
timeout: Duration
) -> Result<bool, ErrorCode>
pub fn verify_proof_timeout(
proof_request_json: &str,
proof_json: &str,
schemas_json: &str,
credential_defs_json: &str,
rev_reg_defs_json: &str,
rev_regs_json: &str,
timeout: Duration
) -> Result<bool, ErrorCode>
Verifies a proof (of multiple credential). All required schemas, public keys and revocation registries must be provided.
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) }proof_json
: created for request proof json { “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}] } schemas_json
: all schema jsons participating in the proof { <schema1_id>: <schema1_json>, <schema2_id>: <schema2_json>, <schema3_id>: <schema3_json>, }credential_defs_json
: all credential definitions json participating in the proof { “cred_def1_id”: <credential_def1_json>, “cred_def2_id”: <credential_def2_json>, “cred_def3_id”: <credential_def3_json>, }rev_reg_defs_json
: all revocation registry definitions json participating in the proof { “rev_reg_def1_id”: <rev_reg_def1_json>, “rev_reg_def2_id”: <rev_reg_def2_json>, “rev_reg_def3_id”: <rev_reg_def3_json>, }rev_regs_json
: all revocation registries json participating in the proof { “rev_reg_def1_id”: { “timestamp1”: <rev_reg1>, “timestamp2”: <rev_reg2>, }, “rev_reg_def2_id”: { “timestamp3”: <rev_reg3> }, “rev_reg_def3_id”: { “timestamp4”: <rev_reg4> }, }timeout
- the maximum time this function waits for a response
Returns
valid
: true - if signature is valid, false - otherwise
sourcepub fn verify_proof_async<F: 'static>(
proof_request_json: &str,
proof_json: &str,
schemas_json: &str,
credential_defs_json: &str,
rev_reg_defs_json: &str,
rev_regs_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, bool) + Send,
pub fn verify_proof_async<F: 'static>(
proof_request_json: &str,
proof_json: &str,
schemas_json: &str,
credential_defs_json: &str,
rev_reg_defs_json: &str,
rev_regs_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, bool) + Send,
Verifies a proof (of multiple credential). All required schemas, public keys and revocation registries must be provided.
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) }proof_json
: created for request proof json { “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}] } schemas_json
: all schema jsons participating in the proof { <schema1_id>: <schema1_json>, <schema2_id>: <schema2_json>, <schema3_id>: <schema3_json>, }credential_defs_json
: all credential definitions json participating in the proof { “cred_def1_id”: <credential_def1_json>, “cred_def2_id”: <credential_def2_json>, “cred_def3_id”: <credential_def3_json>, }rev_reg_defs_json
: all revocation registry definitions json participating in the proof { “rev_reg_def1_id”: <rev_reg_def1_json>, “rev_reg_def2_id”: <rev_reg_def2_json>, “rev_reg_def3_id”: <rev_reg_def3_json>, }rev_regs_json
: all revocation registries json participating in the proof { “rev_reg_def1_id”: { “timestamp1”: <rev_reg1>, “timestamp2”: <rev_reg2>, }, “rev_reg_def2_id”: { “timestamp3”: <rev_reg3> }, “rev_reg_def3_id”: { “timestamp4”: <rev_reg4> }, }closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
Auto Trait Implementations
impl RefUnwindSafe for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnwindSafe for Verifier
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more