Function indy::api::signus::indy_create_and_store_my_did [] [src]

#[no_mangle]
pub extern "C" fn indy_create_and_store_my_did(
    command_handle: i32,
    wallet_handle: i32,
    did_json: *const c_char,
    cb: Option<extern "C" fn(_: i32, _: ErrorCode, _: *const c_char, _: *const c_char, _: *const c_char)>
) -> ErrorCode

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.

Params

wallet_handle: wallet handler (created by open_wallet). command_handle: command handle to map callback to user context. did_json: Identity information as json. Example: { "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; if not provide then a random one will be created) "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;) } cb: Callback that takes command result as parameter.

Returns

DID, verkey (for verification of signature) and public_key (for decryption)

Errors

Common* Wallet* Crypto*