Check credential provided by Issuer for the given credential request,
    updates the credential by a master secret and stores in a secure wallet.
    
    To support efficient search the following tags will be created for stored credential:
        {
            "schema_id": <credential schema id>,
            "schema_issuer_did": <credential schema issuer did>,
            "schema_name": <credential schema name>,
            "schema_version": <credential schema version>,
            "issuer_did": <credential issuer did>,
            "cred_def_id": <credential definition id>,
            "rev_reg_id": <credential revocation registry id>, # "None" as string if not present
            // for every attribute in <credential values>
            "attr::<attribute name>::marker": "1",
            "attr::<attribute name>::value": <attribute raw value>,
        }

    :param wallet_handle: wallet handler (created by open_wallet).
    :param cred_id: (optional, default is a random one) identifier by which credential will be stored in the wallet
    :param cred_req_metadata_json: a credential request metadata created by prover_create_credential_req
    :param cred_json: credential json received from issuer
    :param cred_def_json: credential definition json related to <cred_def_id> in <cred_json>
    :param rev_reg_def_json: revocation registry definition json related to <rev_reg_def_id> in <cred_json>
    :return: cred_id: identifier by which credential is stored in the wallet

async def prover_store_credential(wallet_handle: int,
                                  cred_id: Optional[str],
                                  cred_req_metadata_json: str,
                                  cred_json: str,
                                  cred_def_json: str,
                                  rev_reg_def_json: Optional[str]) -> str:
    """
    Check credential provided by Issuer for the given credential request,
    updates the credential by a master secret and stores in a secure wallet.
    
    To support efficient search the following tags will be created for stored credential:
        {
            "schema_id": <credential schema id>,
            "schema_issuer_did": <credential schema issuer did>,
            "schema_name": <credential schema name>,
            "schema_version": <credential schema version>,
            "issuer_did": <credential issuer did>,
            "cred_def_id": <credential definition id>,
            "rev_reg_id": <credential revocation registry id>, # "None" as string if not present
            // for every attribute in <credential values>
            "attr::<attribute name>::marker": "1",
            "attr::<attribute name>::value": <attribute raw value>,
        }

    :param wallet_handle: wallet handler (created by open_wallet).
    :param cred_id: (optional, default is a random one) identifier by which credential will be stored in the wallet
    :param cred_req_metadata_json: a credential request metadata created by prover_create_credential_req
    :param cred_json: credential json received from issuer
    :param cred_def_json: credential definition json related to <cred_def_id> in <cred_json>
    :param rev_reg_def_json: revocation registry definition json related to <rev_reg_def_id> in <cred_json>
    :return: cred_id: identifier by which credential is stored in the wallet
    """

    logger = logging.getLogger(__name__)
    logger.debug("prover_store_credential: >>> wallet_handle: %r, cred_id: %r, "
                 "cred_req_metadata_json: %r, cred_json: %r, cred_def_json: %r, rev_reg_def_json: %r",
                 wallet_handle,
                 cred_id,
                 cred_req_metadata_json,
                 cred_json,
                 cred_def_json,
                 rev_reg_def_json)

    if not hasattr(prover_store_credential, "cb"):
        logger.debug("prover_store_credential: Creating callback")
        prover_store_credential.cb = create_cb(CFUNCTYPE(None, c_int32, c_int32, c_char_p))

    c_wallet_handle = c_int32(wallet_handle)
    c_cred_id = c_char_p(cred_id.encode('utf-8')) if cred_id else None
    c_cred_req_metadata_json = c_char_p(cred_req_metadata_json.encode('utf-8'))
    c_cred_json = c_char_p(cred_json.encode('utf-8'))
    c_cred_def_json = c_char_p(cred_def_json.encode('utf-8'))
    c_rev_reg_def_json = c_char_p(rev_reg_def_json.encode('utf-8')) if rev_reg_def_json is not None else None

    cred_id = await do_call('indy_prover_store_credential',
                            c_wallet_handle,
                            c_cred_id,
                            c_cred_req_metadata_json,
                            c_cred_json,
                            c_cred_def_json,
                            c_rev_reg_def_json,
                            prover_store_credential.cb)

    res = cred_id.decode()
    logger.debug("prover_store_credential: <<< res: %r", res)
    return res