[−][src]Function indyrs::anoncreds::issuer_create_and_store_credential_def
pub fn issuer_create_and_store_credential_def(
wallet_handle: WalletHandle,
issuer_did: &str,
schema_json: &str,
tag: &str,
signature_type: Option<&str>,
config_json: &str
) -> Box<dyn Future<Item = (String, String), Error = IndyError>>
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.
Note: Use combination of issuer_rotate_credential_def_start
and issuer_rotate_credential_def_apply
functions
to generate new keys for an existing credential definition.
Arguments
wallet_handle
: wallet handle (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 that is implemented according to the algorithm in this paper: https://github.com/hyperledger/ursa/blob/master/libursa/docs/AnonCred.pdf And is documented in this HIPE: https://github.com/hyperledger/indy-hipe/blob/c761c583b1e01c1e9d3ceda2b03b35336fdc8cc1/text/anoncreds-protocol/README.md
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 { id: string - identifier of credential definition schemaId: string - identifier of stored in ledger schema type: string - type of the credential definition. CL is the only supported type now. tag: string - allows to distinct between credential definitions for the same issuer and schema value: Dictionary with Credential Definition's data is depended on the signature type: { primary: primary credential public key, Optional: revocation credential public key }, ver: Version of the CredDef json }
Note: primary
and revocation
fields of credential definition are complex opaque types that contain data structures internal to Ursa.
They should not be parsed and are likely to change in future versions.