[][src]Function indyrs::did::create_and_store_my_did

pub fn create_and_store_my_did(
    wallet_handle: IndyHandle,
    did_json: &str
) -> Box<dyn Future<Item = (String, String), Error = IndyError>>

Creates keys (signing and encryption keys) for a new DID (owned by the caller of the library). Identity's DID must be either explicitly provided, or taken as the first 16 bit of verkey. Saves the Identity DID with keys in a secured Wallet, so that it can be used to sign and encrypt transactions.

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • did_json - Identity information as json.

Examples

did_json { "did": string, (optional; if not provided and cid param is false then the first 16 bit of the verkey will be used as a new DID; if not provided and cid is true then the full verkey will be used as a new DID; if provided, then keys will be replaced - key rotation use case) "seed": string, (optional) Seed that allows deterministic key creation (if not set random one will be created). Can be UTF-8, base64 or hex string. "crypto_type": string, (optional; if not set then ed25519 curve is used; currently only 'ed25519' value is supported for this field) "cid": bool, (optional; if not set then false is used;) }

Returns

  • did - DID generated and stored in the wallet
  • verkey - The DIDs verification key