Struct rust_libindy_wrapper::did::Did[][src]

pub struct Did {}

Methods

impl Did
[src]

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; 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;) }

Returns

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

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.
  • timeout - the maximum time this function waits for a response

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; 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;) }

Returns

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

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.
  • closure - the closure that is called when finished

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; 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;) }

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Generated temporary keys (signing and encryption keys) for an existing DID (owned by the caller of the library).

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • tgt_did - DID to replace keys.
  • identity_json - Identity information as json.

Example

  • identity_json- { "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) }

Returns

  • verkey - The DIDs verification key

Generated temporary keys (signing and encryption keys) for an existing DID (owned by the caller of the library).

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • tgt_did - DID to replace keys.
  • identity_json - Identity information as json.
  • timeout - the maximum time this function waits for a response

Example

  • identity_json- { "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) }

Returns

  • verkey - The DIDs verification key

Generated temporary keys (signing and encryption keys) for an existing DID (owned by the caller of the library).

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • tgt_did - DID to replace keys.
  • identity_json - Identity information as json.
  • closure - the closure that is called when finished

Example

  • identity_json- { "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) }

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Apply temporary keys as main for an existing DID (owned by the caller of the library).

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • tgt_did - DID stored in the wallet

Apply temporary keys as main for an existing DID (owned by the caller of the library).

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • tgt_did - DID stored in the wallet
  • timeout - the maximum time this function waits for a response

Apply temporary keys as main for an existing DID (owned by the caller of the library).

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • tgt_did - DID stored in the wallet
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Saves their DID for a pairwise connection in a secured Wallet, so that it can be used to verify transaction.

Arguments

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

Example:

  • identity_json { "did": string, (required) "verkey": string (optional, can be avoided if did is cryptonym: did == verkey), }

Saves their DID for a pairwise connection in a secured Wallet, so that it can be used to verify transaction.

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • identity_json - Identity information as json.
  • timeout - the maximum time this function waits for a response

Example:

  • identity_json { "did": string, (required) "verkey": string (optional, can be avoided if did is cryptonym: did == verkey), }

Saves their DID for a pairwise connection in a secured Wallet, so that it can be used to verify transaction.

Arguments

  • wallet_handle - wallet handler (created by Wallet::open).
  • identity_json - Identity information as json.
  • closure - the closure that is called when finished

Example:

  • identity_json { "did": string, (required) "verkey": string (optional, can be avoided if did is cryptonym: did == verkey), }

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Returns ver key (key id) for the given DID.

"Did::get_ver_key" call follow the idea that we resolve information about their DID from the ledger with cache in the local wallet. The "indy_Wallet::open" call has freshness parameter that is used for checking the freshness of cached pool value.

Note if you don't want to resolve their DID info from the ledger you can use "Did::get_ver_key" call instead that will look only to the local wallet and skip freshness checking.

Note that "Did::new" makes similar wallet record as "Key::create". As result we can use returned ver key in all generic crypto and messaging functions.

Arguments

  • pool_handle - Pool handle (created by Pool::open).
  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve key.

Returns

  • key - The DIDs ver key (key id).

Returns ver key (key id) for the given DID.

"Did::get_ver_key" call follow the idea that we resolve information about their DID from the ledger with cache in the local wallet. The "indy_Wallet::open" call has freshness parameter that is used for checking the freshness of cached pool value.

Note if you don't want to resolve their DID info from the ledger you can use "Did::get_ver_key" call instead that will look only to the local wallet and skip freshness checking.

Note that "Did::new" makes similar wallet record as "Key::create". As result we can use returned ver key in all generic crypto and messaging functions.

Arguments

  • pool_handle - Pool handle (created by Pool::open).
  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve key.
  • timeout - the maximum time this function waits for a response

Returns

  • key - The DIDs ver key (key id).

Returns ver key (key id) for the given DID.

"Did::get_ver_key" call follow the idea that we resolve information about their DID from the ledger with cache in the local wallet. The "indy_Wallet::open" call has freshness parameter that is used for checking the freshness of cached pool value.

Note if you don't want to resolve their DID info from the ledger you can use "Did::get_ver_key" call instead that will look only to the local wallet and skip freshness checking.

Note that "Did::new" makes similar wallet record as "Key::create". As result we can use returned ver key in all generic crypto and messaging functions.

Arguments

  • pool_handle - Pool handle (created by Pool::open).
  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve key.
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Returns ver key (key id) for the given DID.

"Did::get_ver_key_did" call looks data stored in the local wallet only and skips freshness checking.

Note if you want to get fresh data from the ledger you can use "Did::get_ver_key" call instead.

Note that "Did::new" makes similar wallet record as "Key::create". As result we can use returned ver key in all generic crypto and messaging functions.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve key.

Returns

  • key - The DIDs ver key (key id).

Returns ver key (key id) for the given DID.

"Did::get_ver_key_did" call looks data stored in the local wallet only and skips freshness checking.

Note if you want to get fresh data from the ledger you can use "Did::get_ver_key" call instead.

Note that "Did::new" makes similar wallet record as "Key::create". As result we can use returned ver key in all generic crypto and messaging functions.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve key.
  • timeout - the maximum time this function waits for a response

Returns

  • key - The DIDs ver key (key id).

Returns ver key (key id) for the given DID.

"Did::get_ver_key_did" call looks data stored in the local wallet only and skips freshness checking.

Note if you want to get fresh data from the ledger you can use "Did::get_ver_key" call instead.

Note that "Did::new" makes similar wallet record as "Key::create". As result we can use returned ver key in all generic crypto and messaging functions.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve key.
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Set/replaces endpoint information for the given DID.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve endpoint.
  • address - The DIDs endpoint address.
  • transport_key - The DIDs transport key (ver key, key id).

Set/replaces endpoint information for the given DID.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve endpoint.
  • address - The DIDs endpoint address.
  • transport_key - The DIDs transport key (ver key, key id).
  • timeout - the maximum time this function waits for a response

Set/replaces endpoint information for the given DID.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve endpoint.
  • address - The DIDs endpoint address.
  • transport_key - The DIDs transport key (ver key, key id).
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Returns endpoint information for the given DID.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve endpoint.

Returns

  • endpoint - The DIDs endpoint.
  • transport_vk - The DIDs transport key (ver key, key id).

Returns endpoint information for the given DID.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve endpoint.
  • timeout - the maximum time this function waits for a response

Returns

  • endpoint - The DIDs endpoint.
  • transport_vk - The DIDs transport key (ver key, key id).

Returns endpoint information for the given DID.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to resolve endpoint.
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Saves/replaces the meta information for the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - the DID to store metadata.
  • metadata - the meta information that will be store with the DID.

Saves/replaces the meta information for the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - the DID to store metadata.
  • metadata - the meta information that will be store with the DID.
  • timeout - the maximum time this function waits for a response

Saves/replaces the meta information for the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - the DID to store metadata.
  • metadata - the meta information that will be store with the DID.
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Retrieves the meta information for the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to retrieve metadata.

#Returns

  • metadata - The meta information stored with the DID; Can be null if no metadata was saved for this DID.

Retrieves the meta information for the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to retrieve metadata.
  • timeout - the maximum time this function waits for a response

#Returns

  • metadata - The meta information stored with the DID; Can be null if no metadata was saved for this DID.

Retrieves the meta information for the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to retrieve metadata.
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Retrieves the information about the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to retrieve information.

Returns

  • did_with_meta - { "did": string - DID stored in the wallet, "verkey": string - The DIDs transport key (ver key, key id), "metadata": string - The meta information stored with the DID }

Retrieves the information about the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to retrieve information.
  • timeout - the maximum time this function waits for a response

Returns

  • did_with_meta - { "did": string - DID stored in the wallet, "verkey": string - The DIDs transport key (ver key, key id), "metadata": string - The meta information stored with the DID }

Retrieves the information about the giving DID in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • did - The DID to retrieve information.
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Retrieves the information about all DIDs stored in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).

Returns

  • dids - [{ "did": string - DID stored in the wallet, "verkey": string - The DIDs transport key (ver key, key id)., "metadata": string - The meta information stored with the DID }]

Retrieves the information about all DIDs stored in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • timeout - the maximum time this function waits for a response

Returns

  • dids - [{ "did": string - DID stored in the wallet, "verkey": string - The DIDs transport key (ver key, key id)., "metadata": string - The meta information stored with the DID }]

Retrieves the information about all DIDs stored in the wallet.

Arguments

  • wallet_handle - Wallet handle (created by Wallet::open).
  • closure - the closure that is called when finished

Returns

  • errorcode - errorcode from calling ffi function. The closure receives the return result

Retrieves abbreviated verkey if it is possible otherwise return full verkey.

Arguments

  • tgt_did - DID.
  • full_verkey - The DIDs verification key,

#Returns

  • verkey - The DIDs verification key in either abbreviated or full form

Retrieves abbreviated verkey if it is possible otherwise return full verkey.

Arguments

  • tgt_did - DID.
  • full_verkey - The DIDs verification key,
  • timeout - the maximum time this function waits for a response

#Returns

  • verkey - The DIDs verification key in either abbreviated or full form

Retrieves abbreviated verkey if it is possible otherwise return full verkey.

Arguments

  • tgt_did - DID.
  • full_verkey - The DIDs verification key,
  • 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 Send for Did

impl Sync for Did