pub struct Issuer {}
Implementations
sourceimpl Issuer
impl Issuer
sourcepub fn create_schema(
issuer_did: &str,
name: &str,
version: &str,
attrs: &str
) -> Result<(String, String), ErrorCode>
pub fn create_schema(
issuer_did: &str,
name: &str,
version: &str,
attrs: &str
) -> Result<(String, String), ErrorCode>
Create credential schema entity that describes credential attributes list and allows credentials interoperability.
Schema is public and intended to be shared with all anoncreds workflow actors usually by publishing SCHEMA transaction to Indy distributed ledger.
It is IMPORTANT for current version POST Schema in Ledger and after that GET it from Ledger with correct seq_no to save compatibility with Ledger. After that can call Issuer::create_and_store_credential_def to build corresponding Credential Definition.
Arguments
pool_handle
- pool handle (created by Pool::open_ledger).issuer_did
: DID of schema issuername
: a name the schemaversion
: a version of the schemaattrs
: a list of schema attributes descriptions
Returns
schema_id
: identifier of created schemaschema_json
: schema as json
sourcepub fn create_schema_timeout(
issuer_did: &str,
name: &str,
version: &str,
attrs: &str,
timeout: Duration
) -> Result<(String, String), ErrorCode>
pub fn create_schema_timeout(
issuer_did: &str,
name: &str,
version: &str,
attrs: &str,
timeout: Duration
) -> Result<(String, String), ErrorCode>
Create credential schema entity that describes credential attributes list and allows credentials interoperability.
Schema is public and intended to be shared with all anoncreds workflow actors usually by publishing SCHEMA transaction to Indy distributed ledger.
It is IMPORTANT for current version POST Schema in Ledger and after that GET it from Ledger with correct seq_no to save compatibility with Ledger. After that can call Issuer::create_and_store_credential_def to build corresponding Credential Definition.
Arguments
pool_handle
- pool handle (created by Pool::open_ledger).issuer_did
: DID of schema issuername
: a name the schemaversion
: a version of the schemaattrs
: a list of schema attributes descriptionstimeout
- the maximum time this function waits for a response
Returns
schema_id
: identifier of created schemaschema_json
: schema as json
sourcepub fn create_schema_async<F: 'static>(
issuer_did: &str,
name: &str,
version: &str,
attrs: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, String) + Send,
pub fn create_schema_async<F: 'static>(
issuer_did: &str,
name: &str,
version: &str,
attrs: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, String) + Send,
Create credential schema entity that describes credential attributes list and allows credentials interoperability.
Schema is public and intended to be shared with all anoncreds workflow actors usually by publishing SCHEMA transaction to Indy distributed ledger.
It is IMPORTANT for current version POST Schema in Ledger and after that GET it from Ledger with correct seq_no to save compatibility with Ledger. After that can call Issuer::create_and_store_credential_def to build corresponding Credential Definition.
Arguments
pool_handle
- pool handle (created by Pool::open_ledger).issuer_did
: DID of schema issuername
: a name the schemaversion
: a version of the schemaattrs
: a list of schema attributes descriptionsclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn create_and_store_credential_def(
wallet_handle: IndyHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str
) -> Result<(String, String), ErrorCode>
pub fn create_and_store_credential_def(
wallet_handle: IndyHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str
) -> Result<(String, String), ErrorCode>
Create credential definition entity that encapsulates credentials issuer DID, credential schema, secrets used for signing credentials and secrets used for credentials revocation.
Credential definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be returned as json intended to be shared with all anoncreds workflow actors usually by publishing CRED_DEF transaction to Indy distributed ledger.
It is IMPORTANT for current version GET Schema from Ledger with correct seq_no to save compatibility with Ledger.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).issuer_did
: a DID of the issuer signing cred_def transaction to the Ledgerschema_json
: credential schema as a jsontag
: allows to distinct between credential definitions for the same issuer and schemasignature_type
: credential definition type (optional, ‘CL’ by default) that defines credentials signature and revocation math. Supported types are:- ‘CL’: Camenisch-Lysyanskaya credential signature type
config_json
: (optional) type-specific configuration of credential definition as json:- ‘CL’:
- support_revocation: whether to request non-revocation credential (optional, default false)
- ‘CL’:
Returns
cred_def_id
: identifier of created credential definitioncred_def_json
: public part of created credential definition
sourcepub fn create_and_store_credential_def_timeout(
wallet_handle: IndyHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str,
timeout: Duration
) -> Result<(String, String), ErrorCode>
pub fn create_and_store_credential_def_timeout(
wallet_handle: IndyHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str,
timeout: Duration
) -> Result<(String, String), ErrorCode>
Create credential definition entity that encapsulates credentials issuer DID, credential schema, secrets used for signing credentials and secrets used for credentials revocation.
Credential definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be returned as json intended to be shared with all anoncreds workflow actors usually by publishing CRED_DEF transaction to Indy distributed ledger.
It is IMPORTANT for current version GET Schema from Ledger with correct seq_no to save compatibility with Ledger.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).issuer_did
: a DID of the issuer signing cred_def transaction to the Ledgerschema_json
: credential schema as a jsontag
: allows to distinct between credential definitions for the same issuer and schemasignature_type
: credential definition type (optional, ‘CL’ by default) that defines credentials signature and revocation math. Supported types are:- ‘CL’: Camenisch-Lysyanskaya credential signature type
config_json
: (optional) type-specific configuration of credential definition as json:- ‘CL’:
- support_revocation: whether to request non-revocation credential (optional, default false)
- ‘CL’:
timeout
- the maximum time this function waits for a response
Returns
cred_def_id
: identifier of created credential definitioncred_def_json
: public part of created credential definition
sourcepub fn create_and_store_credential_def_async<F: 'static>(
wallet_handle: IndyHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, String) + Send,
pub fn create_and_store_credential_def_async<F: 'static>(
wallet_handle: IndyHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, String) + Send,
Create credential definition entity that encapsulates credentials issuer DID, credential schema, secrets used for signing credentials and secrets used for credentials revocation.
Credential definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be returned as json intended to be shared with all anoncreds workflow actors usually by publishing CRED_DEF transaction to Indy distributed ledger.
It is IMPORTANT for current version GET Schema from Ledger with correct seq_no to save compatibility with Ledger.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).issuer_did
: a DID of the issuer signing cred_def transaction to the Ledgerschema_json
: credential schema as a jsontag
: allows to distinct between credential definitions for the same issuer and schemasignature_type
: credential definition type (optional, ‘CL’ by default) that defines credentials signature and revocation math. Supported types are:- ‘CL’: Camenisch-Lysyanskaya credential signature type
config_json
: (optional) type-specific configuration of credential definition as json:- ‘CL’:
- support_revocation: whether to request non-revocation credential (optional, default false)
- ‘CL’:
closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn create_and_store_revoc_reg(
wallet_handle: IndyHandle,
issuer_did: &str,
revoc_def_type: Option<&str>,
tag: &str,
cred_def_id: &str,
config_json: &str,
tails_writer_handle: IndyHandle
) -> Result<(String, String, String), ErrorCode>
pub fn create_and_store_revoc_reg(
wallet_handle: IndyHandle,
issuer_did: &str,
revoc_def_type: Option<&str>,
tag: &str,
cred_def_id: &str,
config_json: &str,
tails_writer_handle: IndyHandle
) -> Result<(String, String, String), ErrorCode>
Create a new revocation registry for the given credential definition as tuple of entities
- Revocation registry definition that encapsulates credentials definition reference, revocation type specific configuration and secrets used for credentials revocation
- Revocation registry state that stores the information about revoked entities in a non-disclosing way. The state can be represented as ordered list of revocation registry entries were each entry represents the list of revocation or issuance operations.
Revocation registry definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be returned as json intended to be shared with all anoncreds workflow actors usually by publishing REVOC_REG_DEF transaction to Indy distributed ledger.
Revocation registry state is stored on the wallet and also intended to be shared as the ordered list of REVOC_REG_ENTRY transactions. This call initializes the state in the wallet and returns the initial entry.
Some revocation registry types (for example, ‘CL_ACCUM’) can require generation of binary blob called tails used to hide information about revoked credentials in public revocation registry and intended to be distributed out of leger (REVOC_REG_DEF transaction will still contain uri and hash of tails). This call requires access to pre-configured blob storage writer instance handle that will allow to write generated tails.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).issuer_did
: a DID of the issuer signing transaction to the Ledgerrevoc_def_type
: revocation registry type (optional, default value depends on credential definition type). Supported types are:- ‘CL_ACCUM’: Type-3 pairing based accumulator. Default for ‘CL’ credential definition type
tag
: allows to distinct between revocation registries for the same issuer and credential definitioncred_def_id
: id of stored in ledger credential definitionconfig_json
: type-specific configuration of revocation registry as json:- ‘CL_ACCUM’: { “issuance_type”: (optional) type of issuance. Currently supported: 1) ISSUANCE_BY_DEFAULT: all indices are assumed to be issued and initial accumulator is calculated over all indices; Revocation Registry is updated only during revocation. 2) ISSUANCE_ON_DEMAND: nothing is issued initially accumulator is 1 (used by default); “max_cred_num”: maximum number of credentials the new registry can process (optional, default 100000) }
tails_writer_handle
: handle of blob storage to store tails
Returns
revoc_reg_id
: identifier of created revocation registry definitionrevoc_reg_def_json
: public part of revocation registry definitionrevoc_reg_entry_json
: revocation registry entry that defines initial state of revocation registry
sourcepub fn create_and_store_revoc_reg_timeout(
wallet_handle: IndyHandle,
issuer_did: &str,
revoc_def_type: Option<&str>,
tag: &str,
cred_def_id: &str,
config_json: &str,
tails_writer_handle: IndyHandle,
timeout: Duration
) -> Result<(String, String, String), ErrorCode>
pub fn create_and_store_revoc_reg_timeout(
wallet_handle: IndyHandle,
issuer_did: &str,
revoc_def_type: Option<&str>,
tag: &str,
cred_def_id: &str,
config_json: &str,
tails_writer_handle: IndyHandle,
timeout: Duration
) -> Result<(String, String, String), ErrorCode>
Create a new revocation registry for the given credential definition as tuple of entities
- Revocation registry definition that encapsulates credentials definition reference, revocation type specific configuration and secrets used for credentials revocation
- Revocation registry state that stores the information about revoked entities in a non-disclosing way. The state can be represented as ordered list of revocation registry entries were each entry represents the list of revocation or issuance operations.
Revocation registry definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be returned as json intended to be shared with all anoncreds workflow actors usually by publishing REVOC_REG_DEF transaction to Indy distributed ledger.
Revocation registry state is stored on the wallet and also intended to be shared as the ordered list of REVOC_REG_ENTRY transactions. This call initializes the state in the wallet and returns the initial entry.
Some revocation registry types (for example, ‘CL_ACCUM’) can require generation of binary blob called tails used to hide information about revoked credentials in public revocation registry and intended to be distributed out of leger (REVOC_REG_DEF transaction will still contain uri and hash of tails). This call requires access to pre-configured blob storage writer instance handle that will allow to write generated tails.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).issuer_did
: a DID of the issuer signing transaction to the Ledgerrevoc_def_type
: revocation registry type (optional, default value depends on credential definition type). Supported types are:- ‘CL_ACCUM’: Type-3 pairing based accumulator. Default for ‘CL’ credential definition type
tag
: allows to distinct between revocation registries for the same issuer and credential definitioncred_def_id
: id of stored in ledger credential definitionconfig_json
: type-specific configuration of revocation registry as json:- ‘CL_ACCUM’: { “issuance_type”: (optional) type of issuance. Currently supported: 1) ISSUANCE_BY_DEFAULT: all indices are assumed to be issued and initial accumulator is calculated over all indices; Revocation Registry is updated only during revocation. 2) ISSUANCE_ON_DEMAND: nothing is issued initially accumulator is 1 (used by default); “max_cred_num”: maximum number of credentials the new registry can process (optional, default 100000) }
tails_writer_handle
: handle of blob storage to store tailstimeout
- the maximum time this function waits for a response
Returns
revoc_reg_id
: identifier of created revocation registry definitionrevoc_reg_def_json
: public part of revocation registry definitionrevoc_reg_entry_json
: revocation registry entry that defines initial state of revocation registry
sourcepub fn create_and_store_revoc_reg_async<F: 'static>(
wallet_handle: IndyHandle,
issuer_did: &str,
revoc_def_type: Option<&str>,
tag: &str,
cred_def_id: &str,
config_json: &str,
tails_writer_handle: IndyHandle,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, String, String) + Send,
pub fn create_and_store_revoc_reg_async<F: 'static>(
wallet_handle: IndyHandle,
issuer_did: &str,
revoc_def_type: Option<&str>,
tag: &str,
cred_def_id: &str,
config_json: &str,
tails_writer_handle: IndyHandle,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, String, String) + Send,
Create a new revocation registry for the given credential definition as tuple of entities
- Revocation registry definition that encapsulates credentials definition reference, revocation type specific configuration and secrets used for credentials revocation
- Revocation registry state that stores the information about revoked entities in a non-disclosing way. The state can be represented as ordered list of revocation registry entries were each entry represents the list of revocation or issuance operations.
Revocation registry definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be returned as json intended to be shared with all anoncreds workflow actors usually by publishing REVOC_REG_DEF transaction to Indy distributed ledger.
Revocation registry state is stored on the wallet and also intended to be shared as the ordered list of REVOC_REG_ENTRY transactions. This call initializes the state in the wallet and returns the initial entry.
Some revocation registry types (for example, ‘CL_ACCUM’) can require generation of binary blob called tails used to hide information about revoked credentials in public revocation registry and intended to be distributed out of leger (REVOC_REG_DEF transaction will still contain uri and hash of tails). This call requires access to pre-configured blob storage writer instance handle that will allow to write generated tails.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).issuer_did
: a DID of the issuer signing transaction to the Ledgerrevoc_def_type
: revocation registry type (optional, default value depends on credential definition type). Supported types are:- ‘CL_ACCUM’: Type-3 pairing based accumulator. Default for ‘CL’ credential definition type
tag
: allows to distinct between revocation registries for the same issuer and credential definitioncred_def_id
: id of stored in ledger credential definitionconfig_json
: type-specific configuration of revocation registry as json:- ‘CL_ACCUM’: { “issuance_type”: (optional) type of issuance. Currently supported: 1) ISSUANCE_BY_DEFAULT: all indices are assumed to be issued and initial accumulator is calculated over all indices; Revocation Registry is updated only during revocation. 2) ISSUANCE_ON_DEMAND: nothing is issued initially accumulator is 1 (used by default); “max_cred_num”: maximum number of credentials the new registry can process (optional, default 100000) }
tails_writer_handle
: handle of blob storage to store tailsclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn create_credential_offer(
wallet_handle: IndyHandle,
cred_def_id: &str
) -> Result<String, ErrorCode>
pub fn create_credential_offer(
wallet_handle: IndyHandle,
cred_def_id: &str
) -> Result<String, ErrorCode>
Create credential offer that will be used by Prover for credential request creation. Offer includes nonce and key correctness proof for authentication between protocol steps and integrity checking.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet)cred_def_id
: id of credential definition stored in the wallet
Returns
credential_offer_json
- { “schema_id”: string, “cred_def_id”: string, // Fields below can depend on Cred Def type “nonce”: string, “key_correctness_proof” : <key_correctness_proof> }
sourcepub fn create_credential_offer_timeout(
wallet_handle: IndyHandle,
cred_def_id: &str,
timeout: Duration
) -> Result<String, ErrorCode>
pub fn create_credential_offer_timeout(
wallet_handle: IndyHandle,
cred_def_id: &str,
timeout: Duration
) -> Result<String, ErrorCode>
Create credential offer that will be used by Prover for credential request creation. Offer includes nonce and key correctness proof for authentication between protocol steps and integrity checking.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet)cred_def_id
: id of credential definition stored in the wallettimeout
- the maximum time this function waits for a response
Returns
credential_offer_json
- { “schema_id”: string, “cred_def_id”: string, // Fields below can depend on Cred Def type “nonce”: string, “key_correctness_proof” : <key_correctness_proof> }
sourcepub fn create_credential_offer_async<F: 'static>(
wallet_handle: IndyHandle,
cred_def_id: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
pub fn create_credential_offer_async<F: 'static>(
wallet_handle: IndyHandle,
cred_def_id: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
Create credential offer that will be used by Prover for credential request creation. Offer includes nonce and key correctness proof for authentication between protocol steps and integrity checking.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet)cred_def_id
: id of credential definition stored in the walletclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn create_credential(
wallet_handle: IndyHandle,
cred_offer_json: &str,
cred_req_json: &str,
cred_values_json: &str,
rev_reg_id: Option<&str>,
blob_storage_reader_handle: IndyHandle
) -> Result<(String, Option<String>, Option<String>), ErrorCode>
pub fn create_credential(
wallet_handle: IndyHandle,
cred_offer_json: &str,
cred_req_json: &str,
cred_values_json: &str,
rev_reg_id: Option<&str>,
blob_storage_reader_handle: IndyHandle
) -> Result<(String, Option<String>, Option<String>), ErrorCode>
Check Cred Request for the given Cred Offer and issue Credential for the given Cred Request.
Cred Request must match Cred Offer. The credential definition and revocation registry definition referenced in Cred Offer and Cred Request must be already created and stored into the wallet.
Information for this credential revocation will be store in the wallet as part of revocation registry under generated cred_revoc_id local for this wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transaction. Note that it is possible to accumulate deltas to reduce ledger load.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).cred_offer_json
: a cred offer created by Issuer::create_credential_offercred_req_json
: a credential request created by Prover::store_credentialcred_values_json
: a credential containing attribute values for each of requested attribute names. Example: { “attr1” : {“raw”: “value1”, “encoded”: “value1_as_int” }, “attr2” : {“raw”: “value1”, “encoded”: “value1_as_int” } }rev_reg_id
: id of revocation registry stored in the walletblob_storage_reader_handle
: configuration of blob storage reader handle that will allow to read revocation tails
Returns
cred_json
: Credential json containing signed credential values { “schema_id”: string, “cred_def_id”: string, “rev_reg_def_id”, Optional, “values”: , // Fields below can depend on Cred Def type “signature”: , “signature_correctness_proof”: <signature_correctness_proof> } cred_revoc_id
: local id for revocation info (Can be used for revocation of this credential)revoc_reg_delta_json
: Revocation registry delta json with a newly issued credential
sourcepub fn create_credential_timeout(
wallet_handle: IndyHandle,
cred_offer_json: &str,
cred_req_json: &str,
cred_values_json: &str,
rev_reg_id: Option<&str>,
blob_storage_reader_handle: IndyHandle,
timeout: Duration
) -> Result<(String, Option<String>, Option<String>), ErrorCode>
pub fn create_credential_timeout(
wallet_handle: IndyHandle,
cred_offer_json: &str,
cred_req_json: &str,
cred_values_json: &str,
rev_reg_id: Option<&str>,
blob_storage_reader_handle: IndyHandle,
timeout: Duration
) -> Result<(String, Option<String>, Option<String>), ErrorCode>
Check Cred Request for the given Cred Offer and issue Credential for the given Cred Request.
Cred Request must match Cred Offer. The credential definition and revocation registry definition referenced in Cred Offer and Cred Request must be already created and stored into the wallet.
Information for this credential revocation will be store in the wallet as part of revocation registry under generated cred_revoc_id local for this wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transaction. Note that it is possible to accumulate deltas to reduce ledger load.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).cred_offer_json
: a cred offer created by Issuer::create_credential_offercred_req_json
: a credential request created by Prover::store_credentialcred_values_json
: a credential containing attribute values for each of requested attribute names. Example: { “attr1” : {“raw”: “value1”, “encoded”: “value1_as_int” }, “attr2” : {“raw”: “value1”, “encoded”: “value1_as_int” } }rev_reg_id
: id of revocation registry stored in the walletblob_storage_reader_handle
: configuration of blob storage reader handle that will allow to read revocation tailstimeout
- the maximum time this function waits for a response
Returns
cred_json
: Credential json containing signed credential values { “schema_id”: string, “cred_def_id”: string, “rev_reg_def_id”, Optional, “values”: , // Fields below can depend on Cred Def type “signature”: , “signature_correctness_proof”: <signature_correctness_proof> } cred_revoc_id
: local id for revocation info (Can be used for revocation of this credential)revoc_reg_delta_json
: Revocation registry delta json with a newly issued credential
sourcepub fn create_credential_async<F: 'static>(
wallet_handle: IndyHandle,
cred_offer_json: &str,
cred_req_json: &str,
cred_values_json: &str,
rev_reg_id: Option<&str>,
blob_storage_reader_handle: IndyHandle,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, Option<String>, Option<String>) + Send,
pub fn create_credential_async<F: 'static>(
wallet_handle: IndyHandle,
cred_offer_json: &str,
cred_req_json: &str,
cred_values_json: &str,
rev_reg_id: Option<&str>,
blob_storage_reader_handle: IndyHandle,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String, Option<String>, Option<String>) + Send,
Check Cred Request for the given Cred Offer and issue Credential for the given Cred Request.
Cred Request must match Cred Offer. The credential definition and revocation registry definition referenced in Cred Offer and Cred Request must be already created and stored into the wallet.
Information for this credential revocation will be store in the wallet as part of revocation registry under generated cred_revoc_id local for this wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transaction. Note that it is possible to accumulate deltas to reduce ledger load.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).cred_offer_json
: a cred offer created by Issuer::create_credential_offercred_req_json
: a credential request created by Prover::store_credentialcred_values_json
: a credential containing attribute values for each of requested attribute names. Example: { “attr1” : {“raw”: “value1”, “encoded”: “value1_as_int” }, “attr2” : {“raw”: “value1”, “encoded”: “value1_as_int” } }rev_reg_id
: id of revocation registry stored in the walletblob_storage_reader_handle
: configuration of blob storage reader handle that will allow to read revocation tailsclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn revoke_credential(
wallet_handle: IndyHandle,
blob_storage_reader_cfg_handle: IndyHandle,
rev_reg_id: &str,
cred_revoc_id: &str
) -> Result<String, ErrorCode>
pub fn revoke_credential(
wallet_handle: IndyHandle,
blob_storage_reader_cfg_handle: IndyHandle,
rev_reg_id: &str,
cred_revoc_id: &str
) -> Result<String, ErrorCode>
Revoke a credential identified by a cred_revoc_id (returned by indy_issuer_create_credential).
The corresponding credential definition and revocation registry must be already created an stored into the wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transaction. Note that it is possible to accumulate deltas to reduce ledger load.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).blob_storage_reader_cfg_handle
: configuration of blob storage reader handle that will allow to read revocation tailsrev_reg_id: id of revocation
registry stored in walletcred_revoc_id
: local id for revocation info
Returns
revoc_reg_delta_json
: Revocation registry delta json with a revoked credential
sourcepub fn revoke_credential_timeout(
wallet_handle: IndyHandle,
blob_storage_reader_cfg_handle: IndyHandle,
rev_reg_id: &str,
cred_revoc_id: &str,
timeout: Duration
) -> Result<String, ErrorCode>
pub fn revoke_credential_timeout(
wallet_handle: IndyHandle,
blob_storage_reader_cfg_handle: IndyHandle,
rev_reg_id: &str,
cred_revoc_id: &str,
timeout: Duration
) -> Result<String, ErrorCode>
Revoke a credential identified by a cred_revoc_id (returned by indy_issuer_create_credential).
The corresponding credential definition and revocation registry must be already created an stored into the wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transaction. Note that it is possible to accumulate deltas to reduce ledger load.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).blob_storage_reader_cfg_handle
: configuration of blob storage reader handle that will allow to read revocation tailsrev_reg_id: id of revocation
registry stored in walletcred_revoc_id
: local id for revocation infotimeout
- the maximum time this function waits for a response
Returns
revoc_reg_delta_json
: Revocation registry delta json with a revoked credential
sourcepub fn revoke_credential_async<F: 'static>(
wallet_handle: IndyHandle,
blob_storage_reader_cfg_handle: IndyHandle,
rev_reg_id: &str,
cred_revoc_id: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
pub fn revoke_credential_async<F: 'static>(
wallet_handle: IndyHandle,
blob_storage_reader_cfg_handle: IndyHandle,
rev_reg_id: &str,
cred_revoc_id: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
Revoke a credential identified by a cred_revoc_id (returned by indy_issuer_create_credential).
The corresponding credential definition and revocation registry must be already created an stored into the wallet.
This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transaction. Note that it is possible to accumulate deltas to reduce ledger load.
Arguments
wallet_handle
: wallet handler (created by Wallet::open_wallet).blob_storage_reader_cfg_handle
: configuration of blob storage reader handle that will allow to read revocation tailsrev_reg_id: id of revocation
registry stored in walletcred_revoc_id
: local id for revocation infoclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn merge_revocation_registry_deltas(
rev_reg_delta_json: &str,
other_rev_reg_delta_json: &str
) -> Result<String, ErrorCode>
pub fn merge_revocation_registry_deltas(
rev_reg_delta_json: &str,
other_rev_reg_delta_json: &str
) -> Result<String, ErrorCode>
Merge two revocation registry deltas (returned by Issuer::create_credential or Issuer::revoke_credential) to accumulate common delta. Send common delta to ledger to reduce the load.
Arguments
rev_reg_delta_json
: revocation registry delta.other_rev_reg_delta_json
: revocation registry delta for which PrevAccum value is equal to current accum value of rev_reg_delta_json.
Returns
merged_rev_reg_delta
- Merged revocation registry delta
sourcepub fn merge_revocation_registry_deltas_timeout(
rev_reg_delta_json: &str,
other_rev_reg_delta_json: &str,
timeout: Duration
) -> Result<String, ErrorCode>
pub fn merge_revocation_registry_deltas_timeout(
rev_reg_delta_json: &str,
other_rev_reg_delta_json: &str,
timeout: Duration
) -> Result<String, ErrorCode>
Merge two revocation registry deltas (returned by Issuer::create_credential or Issuer::revoke_credential) to accumulate common delta. Send common delta to ledger to reduce the load.
Arguments
rev_reg_delta_json
: revocation registry delta.other_rev_reg_delta_json
: revocation registry delta for which PrevAccum value is equal to current accum value of rev_reg_delta_json.timeout
- the maximum time this function waits for a response
Returns
merged_rev_reg_delta
- Merged revocation registry delta
sourcepub fn merge_revocation_registry_deltas_async<F: 'static>(
rev_reg_delta_json: &str,
other_rev_reg_delta_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
pub fn merge_revocation_registry_deltas_async<F: 'static>(
rev_reg_delta_json: &str,
other_rev_reg_delta_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
Merge two revocation registry deltas (returned by Issuer::create_credential or Issuer::revoke_credential) to accumulate common delta. Send common delta to ledger to reduce the load.
Arguments
rev_reg_delta_json
: revocation registry delta.other_rev_reg_delta_json
: revocation registry delta for which PrevAccum value is equal to current accum value of rev_reg_delta_json.closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result