Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Latest commit

 

History

History
1986 lines (1958 loc) · 52.1 KB

migration-guide-1.3.0-1.4.0.md

File metadata and controls

1986 lines (1958 loc) · 52.1 KB

Libindy migration Guide from v.1.3.0 to 1.4.0

A Developer Guide for Libindy migration

There are a lot APIs that have been changed in Libindy 1.4.0. This document is written for developers using Libindy 1.3.0 to provide necessary information and to simplify their transition to API of Libindy 1.4.0.

Notes

In the following tables, there are mappings for each Libindy API part of how 1.3.0 functionality maps to 1.4.0.

Functions from version 1.3.0 are listed in the left column, and the equivalent 1.4.0 function is placed in the right column.

  • If some function had been added, the word 'NEW' would be placed in the left column.
  • If some function had been deleted, the word 'DELETED' would be placed in the right column.
  • If some function had been changed, the current format would be placed in the right column.
  • If some function had not been changed, the symbol '=' would be placed in the right column.
  • To get more details about current format of a function click on the description above it.
  • Bellow are signatures of functions in Libindy C API. The params of cb (except command_handle and err) will be result values of the similar function in any Libindy wrapper.

Anoncreds API mapping

Anoncreds API is the most affected part of Libindy. The complete design of Anoncreds can be found here.

Here are three main types of changes that have been done:

  • Improved support of Revocation.
  • Changed signature of some functions to avoid persisting in wallet intermediate steps entities.
  • Changed format of some input and output objects such as filter, proof request, credential info and etc to use different identifiers for public entities:
    • Schema - id in the format did | marker | name | version instead of triple name, version, did .
    • Credential Definition - id in the format did | marker | signatureType | schemaID instead of pair did, schema_key.
    • Revocation Registry - id in the format did | marker | credDefID | revocDefType | revocDefTag instead of seqNo.
v1.3.0 - Anoncreds API v1.4.0 - Anoncreds API
Issuer create Credential Schema
NEW
indy_issuer_create_schema(
            command_handle: i32,
            issuer_did: *const c_char,
            name: *const c_char,
            version: *const c_char,
            attrs: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   schema_id: *const c_char, 
                   schema_json: *const c_char))
        
Issuer create Credential Definition for the given Schema
indy_issuer_create_and_store_claim_def(
        command_handle: i32,
        wallet_handle: i32,
        issuer_did: *const c_char,
        schema_json: *const c_char,
        signature_type: *const c_char,
        create_non_revoc: bool,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               claim_def_json: *const c_char))
        
indy_issuer_create_and_store_credential_def(
        command_handle: i32,
        wallet_handle: i32,
        issuer_did: *const c_char,
        schema_json: *const c_char,
        tag: *const c_char,
        signature_type: *const c_char,
        config_json: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               cred_def_id: *const c_char,
               cred_def_json: *const c_char))
        
It is IMPORTANT for current Pool version get Schema from Ledger with correct seqNo to save backward compatibility before the creation of Credential Definition.
Issuer create a new revocation registry for the given Credential Definition
indy_issuer_create_and_store_revoc_reg(
        command_handle: i32,
        wallet_handle: i32,
        issuer_did: *const c_char,
        schema_seq_no: i32,
        max_claim_num: i32,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               revoc_reg_json: *const c_char))
        
indy_issuer_create_and_store_revoc_reg(
    command_handle: i32,
    wallet_handle: i32,
    issuer_did: *const c_char,
    revoc_def_type: *const c_char,
    tag: *const c_char,
    cred_def_id: *const c_char,
    config_json: *const c_char,
    tails_writer_handle: i32,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           revoc_reg_id: *const c_char,
           revoc_reg_def_json: *const c_char,
           revoc_reg_entry_json: *const c_char))
        
Issuer create credential offer
NEW
indy_issuer_create_credential_offer(
    command_handle: i32,
    wallet_handle: i32,
    cred_def_id: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           cred_offer_json: *const c_char))
Note: The format of Credential Offer has been changed
Issuer issue Credential for the given Credential Request
indy_issuer_create_claim(
    command_handle: i32,
    wallet_handle: i32,
    claim_req_json: *const c_char,
    claim_json: *const c_char,
    user_revoc_index: i32,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           revoc_reg_update_json: *const c_char,
           xclaim_json: *const c_char))
        
indy_issuer_create_credential(
    command_handle: i32,
    wallet_handle: i32,
    cred_offer_json: *const c_char,
    cred_req_json: *const c_char,
    cred_values_json: *const c_char,
    rev_reg_id: *const c_char,
    blob_storage_reader_handle: i32,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           cred_json: *const c_char,
           cred_revoc_id: *const c_char,
           revoc_reg_delta_json: *const c_char))
        
Note: The format of Credential has been changed
Issuer revoke a credential
indy_issuer_revoke_claim(
    command_handle: i32,
    wallet_handle: i32,
    issuer_did: *const c_char,
    schema_seq_no: i32,
    user_revoc_index: i32,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           revoc_reg_update_json: *const c_char))
        
indy_issuer_revoke_credential(
    command_handle: i32,
    wallet_handle: i32,
    blob_storage_reader_cfg_handle: i32,
    rev_reg_id: *const c_char,
    cred_revoc_id: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           revoc_reg_delta_json: *const c_char))
        
Issuer merge two revocation registry deltas
NEW
indy_issuer_merge_revocation_registry_deltas(
    command_handle: i32,
    rev_reg_delta_json: *const c_char,
    other_rev_reg_delta_json: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           merged_rev_reg_delta: *const c_char))
        
Prover stores a Claim Offer from the given issuer in a secure storage.
indy_prover_store_claim_offer(
            command_handle: i32,
            wallet_handle: i32,
            claim_offer_json: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode))
        
DELETED
Prover gets all stored Claim Offers
indy_prover_get_claim_offers(
        command_handle: i32,
        wallet_handle: i32,
        filter_json: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               claim_offers_json: *const c_char))
        
DELETED
Prover creates a Master Secret
indy_prover_create_master_secret(
            command_handle: i32,
            wallet_handle: i32,
            master_secret_name: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode))
        
indy_prover_create_master_secret(
    command_handle: i32,
    wallet_handle: i32,
    master_secret_id: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           out_master_secret_id: *const c_char))
        
Prover creates a Credential Request for the given Credential Offer
indy_prover_create_and_store_claim_req(
        command_handle: i32,
        wallet_handle: i32,
        prover_did: *const c_char,
        claim_offer_json: *const c_char,
        claim_def_json: *const c_char,
        master_secret_name: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               claim_req_json: *const c_char))
        
indy_prover_create_credential_req(
    command_handle: i32,
    wallet_handle: i32,
    prover_did: *const c_char,
    cred_offer_json: *const c_char,
    cred_def_json: *const c_char,
    master_secret_id: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           cred_req_json: *const c_char,
           cred_req_metadata_json: *const c_char))
        
Note: The format of Credential Request has been changed
Prover stores Credential in a secure wallet
indy_prover_store_claim(
                command_handle: i32,
                wallet_handle: i32,
                claims_json: *const c_char,
                cb: fn(xcommand_handle: i32, 
                       err: ErrorCode))
        
indy_prover_store_credential(
        command_handle: i32,
        wallet_handle: i32,
        cred_id: *const c_char,
        cred_req_metadata_json: *const c_char,
        cred_json: *const c_char,
        cred_def_json: *const c_char,
        rev_reg_def_json: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               out_cred_id: *const c_char))
        
Prover gets human readable claims according to the filter
indy_prover_get_claims(
            command_handle: i32,
            wallet_handle: i32,
            filter_json: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   claims_json: *const c_char))
        
indy_prover_get_credentials(
    command_handle: i32,
    wallet_handle: i32,
    filter_json: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           matched_credentials: *const c_char))
        
Note: The formats of Filter and Matched Credential have been changed
Prover gets human readable credentials matching the given proof request
indy_prover_get_claims_for_proof_req(
            command_handle: i32,
            wallet_handle: i32,
            proof_request_json: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   claims_json: *const c_char))
        
indy_prover_get_credentials_for_proof_req(
        command_handle: i32,
        wallet_handle: i32,
        proof_request_json: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               credentials_json: *const c_char))
        
Note: The formats of Proof Request and Matched Credential have been changed
Prover creates a proof according to the given proof request
fn indy_prover_create_proof(
        command_handle: i32,
        wallet_handle: i32,
        proof_req_json: *const c_char,
        requested_claims_json: *const c_char,
        schemas_json: *const c_char,
        master_secret_name: *const c_char,
        claim_defs_json: *const c_char,
        revoc_regs_json: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               proof_json: *const c_char))
        
indy_prover_create_proof(
        command_handle: i32,
        wallet_handle: i32,
        proof_req_json: *const c_char,
        requested_credentials_json: *const c_char,
        master_secret_id: *const c_char,
        schemas_json: *const c_char,
        credential_defs_json: *const c_char,
        rev_states_json: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               proof_json: *const c_char))
        
Note: The formats of Proof Request, Requested Credentials and Proof have been changed
Verifier verifies a proof
indy_verifier_verify_proof(
            command_handle: i32,
            proof_request_json: *const c_char,
            proof_json: *const c_char,
            schemas_json: *const c_char,
            claim_defs_jsons: *const c_char,
            revoc_regs_json: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   valid: bool))
        
indy_verifier_verify_proof(
            command_handle: i32,
            proof_request_json: *const c_char,
            proof_json: *const c_char,
            schemas_json: *const c_char,
            credential_defs_json: *const c_char,
            rev_reg_defs_json: *const c_char,
            rev_regs_json: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   valid: bool))
        
Note: The formats of Proof Request and Proof have been changed
Create revocation state for a credential in the particular time moment
NEW
indy_create_revocation_state(
        command_handle: i32,
        blob_storage_reader_handle: i32,
        rev_reg_def_json: *const c_char,
        rev_reg_delta_json: *const c_char,
        timestamp: u64,
        cred_rev_id: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               rev_state_json: *const c_char))
        
Create new revocation state for a credential based on existed
NEW
indy_update_revocation_state(
    command_handle: i32,
    blob_storage_reader_handle: i32,
    rev_state_json: *const c_char,
    rev_reg_def_json: *const c_char,
    rev_reg_delta_json: *const c_char,
    timestamp: u64,
    cred_rev_id: *const c_char,
    cb: fn(xcommand_handle: i32,
           err: ErrorCode,
           updated_rev_state_json: *const c_char))
        

Blob Storage API mapping

CL revocation schema introduces Revocation Tails entity used to hide information about revoked credential. Tails are static information that may require huge amount of data and stored outside of Libindy wallet. A way how to access tails blobs can be very application specific. To access this Libindy 1.4.0 provides new Blob Storage API.

v1.4.0 - Blob Storage API
Open Blob Storage reader
indy_open_blob_storage_reader(
                command_handle: i32,
                type_: *const c_char,
                config_json: *const c_char,
                cb: fn(command_handle_: i32, 
                       err: ErrorCode, 
                       handle: i32))
        
Open Blob Storage writer
indy_open_blob_storage_writer(command_handle: i32,
                              type_: *const c_char,
                              config_json: *const c_char,
                              cb: fn(command_handle_: i32,
                                     err: ErrorCode, 
                                     handle: i32))
        

Ledger API mapping

There are four types of changes in Ledger API:

  • Added new transaction builders for Revocation support
  • Added new transaction builders for Pool support
  • Added parsers of transaction responses related to entities participating in Anoncreds
  • Changed params of some transaction builders
v1.3.0 - Ledger API v1.4.0 - Ledger API
Builds a SCHEMA request
indy_build_schema_request(
            command_handle: i32,
            submitter_did: *const c_char,
            data: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Left the same but the format of data has been changed to:
{
    id: identifier of schema
    attrNames: array of attribute name strings
    name: Schema's name string
    version: Schema's version string,
    ver: version of the Schema json
}
Builds a GET_SCHEMA request
indy_build_get_schema_request(
            command_handle: i32,
            submitter_did: *const c_char,
            dest: *const c_char,
            data: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
indy_build_get_schema_request(
            command_handle: i32,
            submitter_did: *const c_char,
            id: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Parse a GET_SCHEMA response
NEW
indy_parse_get_schema_response(
            command_handle: i32,
            get_schema_response: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   schema_id: *const c_char,
                   schema_json: *const c_char))
              
Builds an CRED_DEF request
indy_build_claim_def_txn(
    command_handle: i32,
    submitter_did: *const c_char,
    xref: i32,
    signature_type: *const c_char,
    data: *const c_char,
    cb: fn(xcommand_handle: i32, 
           err: ErrorCode,
           request_result_json: *const c_char))
              
indy_build_cred_def_request(
        command_handle: i32,
        submitter_did: *const c_char,
        data: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               request_result_json: *const c_char))
              
Builds a GET_CRED_DEF request
indy_build_get_claim_def_txn(
        command_handle: i32,
        submitter_did: *const c_char,
        xref: i32,
        signature_type: *const c_char,
        origin: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               request_json: *const c_char))
              
indy_build_get_cred_def_request(
        command_handle: i32,
        submitter_did: *const c_char,
        id: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               request_json: *const c_char))
              
Parse a GET_CRED_DEF response
NEW
indy_parse_get_cred_def_response(
        command_handle: i32,
        get_cred_def_response: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               cred_def_id: *const c_char,
               cred_def_json: *const c_char))
              
Builds a POOL_CONFIG request
NEW
indy_build_pool_config_request(
            command_handle: i32,
            submitter_did: *const c_char,
            writes: bool,
            force: bool,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Builds a POOL_UPGRADE request
NEW
indy_build_pool_upgrade_request(
            command_handle: i32,
            submitter_did: *const c_char,
            name: *const c_char,
            version: *const c_char,
            action: *const c_char,
            sha256: *const c_char,
            timeout: i32,
            schedule: *const c_char,
            justification: *const c_char,
            reinstall: bool,
            force: bool,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Builds a REVOC_REG_DEF request
NEW
indy_build_revoc_reg_def_request(
        command_handle: i32,
        submitter_did: *const c_char,
        data: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               rev_reg_def_req: *const c_char))
              
Builds a GET_REVOC_REG_DEF request
NEW
indy_build_get_revoc_reg_def_request(
            command_handle: i32,
            submitter_did: *const c_char,
            id: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Parse a GET_REVOC_REG_DEF response
NEW
indy_parse_get_revoc_reg_def_response(
        command_handle: i32,
        get_revoc_reg_def_response: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               revoc_reg_def_id: *const c_char,
               revoc_reg_def_json: *const c_char))
              
Builds a REVOC_REG_ENTRY request
NEW
indy_build_revoc_reg_entry_request(
            command_handle: i32,
            submitter_did: *const c_char,
            revoc_reg_def_id: *const c_char,
            rev_def_type: *const c_char,
            value: *const c_char,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Builds a GET_REVOC_REG request
NEW
indy_build_get_revoc_reg_request(
            command_handle: i32,
            submitter_did: *const c_char,
            revoc_reg_def_id: *const c_char,
            timestamp: i64,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   request_json: *const c_char))
              
Parse a GET_REVOC_REG response
NEW
indy_parse_get_revoc_reg_response(
        command_handle: i32,
        get_revoc_reg_response: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               revoc_reg_def_id: *const c_char,
               revoc_reg_json: *const c_char,
               timestamp: u64))
              
Builds a GET_REVOC_REG_DELTA request
NEW
indy_build_get_revoc_reg_delta_request(
        command_handle: i32,
        submitter_did: *const c_char,
        revoc_reg_def_id: *const c_char,
        from: i64,
        to: i64,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
                request_json: *const c_char))
              
Parse a GET_REVOC_REG_DELTA response
NEW
indy_parse_get_revoc_reg_delta_response(
        command_handle: i32,
        get_revoc_reg_delta_response: *const c_char,
        cb: fn(xcommand_handle: i32, 
               err: ErrorCode,
               revoc_reg_def_id: *const c_char,
               revoc_reg_delta_json: *const c_char,
               timestamp: u64))
              
Signs and submits request message to validator pool
indy_sign_and_submit_request(...)
       
=
Send request message to validator pool
indy_submit_request(...)
       
=
Signs request message
indy_sign_request(...)
       
=
Builds a NYM request
indy_build_nym_request(...)
       
=
Builds a GET_NYM request
indy_build_get_nym_request(...)
       
=
Builds an ATTRIB request
indy_build_attrib_request(...)
       
=
Builds a GET_ATTRIB request
indy_build_get_attrib_request(...)
       
=
Builds a NODE request
indy_build_node_request(...)
       
=
Builds a GET_TXN request
indy_build_get_txn_request(...)
       
=

Signus API mapping

The most significant change of this part is renaming Signus API to Did API. Furthermore, some functions of Signus API has been deleted because the same goals can be achieved by using a combination of others.

v1.3.0 - Signus API v1.4.0 - Crypto API
Signs a message
indy_sign(...)
               
DELETED (use combination of either did.indy_key_for_did or did.indy_key_for_local_did with crypto.indy_crypto_sign instead)
Verify a signature
indy_verify_signature(...)
               
DELETED (use combination of either did.indy_key_for_did or did.indy_key_for_local_did with crypto.indy_crypto_verify instead)
Encrypts a message
indy_encrypt(...)
               
DELETED (use combination of either did.indy_key_for_did or did.indy_key_for_local_did with crypto.indy_crypto_auth_crypt instead)
Decrypts a message
indy_decrypt(...)
               
DELETED (use combination of either did.indy_key_for_did or did.indy_key_for_local_did with crypto.indy_crypto_auth_decrypt instead)
Encrypts a message by anonymous-encryption scheme
indy_encrypt_sealed(...)
               
DELETED (use combination of either did.indy_key_for_did or did.indy_key_for_local_did with crypto.indy_crypto_anon_crypt instead)
Decrypts a message by anonymous-encryption scheme
indy_decrypt_sealed(...)
               
DELETED (use combination of either did.indy_key_for_did or did.indy_key_for_local_did with crypto.indy_crypto_anon_decrypt instead)
Get info about My DID
NEW
indy_get_my_did_with_meta(command_handle: i32,
                          wallet_handle: i32,
                          my_did: *const c_char,
                          cb: fn(xcommand_handle: i32,
                                 err: ErrorCode,
                                 did_with_meta: *const c_char))
               
Lists created DIDs with metadata
NEW
indy_list_my_dids_with_meta(command_handle: i32,
                            wallet_handle: i32,
                            cb: fn(xcommand_handle: i32, 
                                   err: ErrorCode,
                                   ids: *const c_char))
               
Retrieves abbreviated verkey if it is possible otherwise return full verkey.
NEW
indy_abbreviate_verkey(command_handle: i32,
                       did: *const c_char,
                       full_verkey: *const c_char,
                       cb: fn(xcommand_handle: i32, 
                              err: ErrorCode,
                              verkey: *const c_char))
               
Creates key for a new DID
indy_create_and_store_my_did(...)
              
=
Generated temporary key for an existing DID.
indy_replace_keys_start(...)
              
=
Apply temporary key as main for an existing DID
indy_replace_keys_apply(...)
              
=
Saves their DID for a pairwise connection in a secured Wallet
indy_store_their_did(...)
              
=
Returns ver key (key id) for the given DID.
indy_key_for_did(...)
              
=
Returns ver key (key id) for the given DID.
indy_key_for_local_did(...)
              
=
Set/replace endpoint information for the given DID.
indy_set_endpoint_for_did(...)
              
=
Gets endpoint information for the given DID.
indy_get_endpoint_for_did(...)
              
=
Saves/replaces the meta information for the giving DID in the wallet.
indy_set_did_metadata(...)
              
=
Retrieves the meta information for the giving DID in the wallet.
indy_get_did_metadata(...)
      
=

Crypto API mapping

v1.3.0 - Crypto API v1.4.0 - Crypto API
Encrypt a message by authenticated-encryption scheme.
indy_crypto_box(
            command_handle: i32,
            wallet_handle: i32,
            my_vk: *const c_char,
            their_vk: *const c_char,
            message_raw: *const u8,
            message_len: u32,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   encrypted_msg_raw: *const u8, 
                   encrypted_msg_len: u32,
                   nonce_raw: *const u8, 
                   nonce_len: u32))
        
indy_crypto_auth_crypt(
                command_handle: i32,
                wallet_handle: i32,
                my_vk: *const c_char,
                their_vk: *const c_char,
                msg_data: *const u8,
                msg_len: u32,
                cb: fn(command_handle_: i32,
                       err: ErrorCode,
                       encrypted_msg: *const u8,
                       encrypted_len: u32))
        
Decrypt a message by authenticated-encryption scheme.
indy_crypto_box_open(
            command_handle: i32,
            wallet_handle: i32,
            my_vk: *const c_char,
            their_vk: *const c_char,
            encrypted_msg_raw: *const u8,
            encrypted_msg_len: u32,
            nonce_raw: *const u8,
            nonce_len: u32,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   decrypted_msg_raw: *const u8, 
                   decrypted_msg_len: u32))
        
indy_crypto_auth_decrypt(
                command_handle: i32,
                wallet_handle: i32,
                my_vk: *const c_char,
                encrypted_msg: *const u8,
                encrypted_len: u32,
                cb: fn(command_handle_: i32,
                       err: ErrorCode,
                       their_vk: *const c_char,
                       msg_data: *const u8,
                       msg_len: u32))
        
Encrypts a message by anonymous-encryption scheme.
indy_crypto_box_seal(
            command_handle: i32,
            their_vk: *const c_char,
            message_raw: *const u8,
            message_len: u32,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   encrypted_msg_raw: *const u8, 
                   encrypted_msg_len: u32))
        
indy_crypto_anon_crypt(
                command_handle: i32,
                their_vk: *const c_char,
                msg_data: *const u8,
                msg_len: u32,
                cb: fn(command_handle_: i32,
                       err: ErrorCode,
                       encrypted_msg: *const u8,
                       encrypted_len: u32))
        
Decrypts a message by anonymous-encryption scheme.
indy_crypto_box_seal_open(
            command_handle: i32,
            wallet_handle: i32,
            my_vk: *const c_char,
            encrypted_msg_raw: *const u8,
            encrypted_msg_len: u32,
            cb: fn(xcommand_handle: i32, 
                   err: ErrorCode,
                   decrypted_msg_raw: *const u8, 
                   decrypted_msg_len: u32))
        
indy_crypto_anon_decrypt(
                command_handle: i32,
                wallet_handle: i32,
                my_vk: *const c_char,
                encrypted_msg: *const u8,
                encrypted_len: u32,
                cb: fn(command_handle_: i32,
                       err: ErrorCode,
                       msg_data: *const u8,
                       msg_len: u32))
        
Creates keys pair and stores in the wallet.
  indy_create_key(...)
                
=
Saves/replaces the meta information for the giving key in the wallet.
  indy_set_key_metadata(...)
                
=
Retrieves the meta information for the giving key in the wallet.
  indy_get_key_metadata(...)
                
=
Signs a message with a key.
  indy_crypto_sign(...)
                
=
Verify a signature with a verkey.
  indy_crypto_verify(...)
                
=

Agent API mapping

The Agent API was completely deleted from Libindy but its functionality can be achieved by using Crypto API.

v1.3.0 - Agent API v1.4.0 - Crypto API
Encrypt a message by authenticated-encryption scheme
indy_prep_msg(
            command_handle: i32,
            wallet_handle: i32,
            sender_vk: *const c_char,
            recipient_vk: *const c_char,
            msg_data: *const u8,
            msg_len: u32,
            cb: fn(command_handle_: i32,
                   err: ErrorCode,
                   encrypted_msg: *const u8,
                   encrypted_len: u32))
              
indy_crypto_auth_crypt(
            command_handle: i32,
            wallet_handle: i32,
            my_vk: *const c_char,
            their_vk: *const c_char,
            msg_data: *const u8,
            msg_len: u32,
            cb: fn(command_handle_: i32,
                   err: ErrorCode,
                   encrypted_msg: *const u8,
                   encrypted_len: u32))
        
Encrypts a message by anonymous-encryption scheme.
indy_prep_anonymous_msg(
          command_handle: i32,
          recipient_vk: *const c_char,
          msg_data: *const u8,
          msg_len: u32,
          cb: fn(command_handle_: i32,
                 err: ErrorCode,
                 encrypted_msg: *const u8,
                 encrypted_len: u32))
        
indy_crypto_anon_crypt(
          command_handle: i32,
          their_vk: *const c_char,
          msg_data: *const u8,
          msg_len: u32,
          cb: fn(command_handle_: i32,
                 err: ErrorCode,
                 encrypted_msg: *const u8,
                 encrypted_len: u32))
        
Decrypts a message.
indy_parse_msg(
            command_handle: i32,
            wallet_handle: i32,
            recipient_vk: *const c_char,
            encrypted_msg: *const u8,
            encrypted_len: u32,
            cb: fn(command_handle_: i32,
                   err: ErrorCode,
                   sender_vk: *const c_char,
                   msg_data: *const u8,
                   msg_len: u32))
      
Decrypt a message by authenticated-encryption scheme.
Reverse to indy_crypto_auth_crypt
indy_crypto_auth_decrypt( command_handle: i32, wallet_handle: i32, my_vk: *const c_char, encrypted_msg: *const u8, encrypted_len: u32, cb: fn(command_handle_: i32, err: ErrorCode, their_vk: *const c_char, msg_data: *const u8, msg_len: u32))
Decrypts a message by anonymous-encryption scheme.
Reverse to indy_crypto_anon_crypt
indy_crypto_anon_decrypt(command_handle: i32, wallet_handle: i32, my_vk: *const c_char, encrypted_msg: *const u8, encrypted_len: u32, cb: fn(command_handle_: i32, err: ErrorCode, msg_data: *const u8, msg_len: u32))

Pairwise API mapping

The Agent API has not been changed.

Pool API mapping

The Pool API has not been changed.

Wallet API mapping

The Wallet API has not been changed.

Explore the Code

Here you can find integration tests that demonstrates basic revocation scenario using Libindy and Ledger