1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
use super::*;

use {CString, Error, Handle};

extern {

    #[no_mangle]
    pub fn indy_issuer_create_schema(command_handle: Handle,
                                     issuer_did: CString,
                                     name: CString,
                                     version: CString,
                                     attrs: CString,
                                     cb: Option<ResponseStringStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_issuer_create_and_store_credential_def(command_handle: Handle,
                                                       wallet_handle: Handle,
                                                       issuer_did: CString,
                                                       schema_json: CString,
                                                       tag: CString,
                                                       signature_type: CString,
                                                       config_json: CString,
                                                       cb: Option<ResponseStringStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_issuer_create_and_store_revoc_reg(command_handle: Handle,
                                                  wallet_handle: Handle,
                                                  issuer_did: CString,
                                                  revoc_def_type: CString,
                                                  tag: CString,
                                                  cred_def_id: CString,
                                                  config_json: CString,
                                                  tails_writer_handle: Handle,
                                                  cb: Option<ResponseStringStringStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_issuer_create_credential_offer(command_handle: Handle,
                                               wallet_handle: Handle,
                                               cred_def_id: CString,
                                               cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_issuer_create_credential(command_handle: Handle,
                                         wallet_handle: Handle,
                                         cred_offer_json: CString,
                                         cred_req_json: CString,
                                         cred_values_json: CString,
                                         rev_reg_id: CString,
                                         blob_storage_reader_handle: Handle,
                                         cb: Option<ResponseStringStringStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_issuer_revoke_credential(command_handle: Handle,
                                         wallet_handle: Handle,
                                         blob_storage_reader_cfg_handle: Handle,
                                         rev_reg_id: CString,
                                         cred_revoc_id: CString,
                                         cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_issuer_merge_revocation_registry_deltas(command_handle: Handle,
                                                        rev_reg_delta_json: CString,
                                                        other_rev_reg_delta_json: CString,
                                                        cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_create_master_secret(command_handle: Handle,
                                            wallet_handle: Handle,
                                            master_secret_id: CString,
                                            cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_create_credential_req(command_handle: Handle,
                                             wallet_handle: Handle,
                                             prover_did: CString,
                                             cred_offer_json: CString,
                                             cred_def_json: CString,
                                             master_secret_id: CString,
                                             cb: Option<ResponseStringStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_store_credential(command_handle: Handle,
                                        wallet_handle: Handle,
                                        cred_id: CString,
                                        cred_req_metadata_json: CString,
                                        cred_json: CString,
                                        cred_def_json: CString,
                                        rev_reg_def_json: CString,
                                        cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_get_credential(command_handle: Handle,
                                      wallet_handle: Handle,
                                      cred_id: CString,
                                      cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_get_credentials(command_handle: Handle,
                                       wallet_handle: Handle,
                                       filter_json: CString,
                                       cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_search_credentials(command_handle: Handle,
                                          wallet_handle: Handle,
                                          query_json: CString,
                                          cb: Option<ResponseI32UsizeCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_fetch_credentials(command_handle: Handle,
                                         search_handle: Handle,
                                         count: usize,
                                         cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_close_credentials_search(command_handle: Handle,
                                                search_handle: Handle,
                                                cb: Option<ResponseEmptyCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_get_credentials_for_proof_req(command_handle: Handle,
                                                     wallet_handle: Handle,
                                                     proof_request_json: CString,
                                                     cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_search_credentials_for_proof_req(command_handle: Handle,
                                                        wallet_handle: Handle,
                                                        proof_request_json: CString,
                                                        extra_query_json: CString,
                                                        cb: Option<ResponseI32CB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_fetch_credentials_for_proof_req(command_handle: Handle,
                                                       search_handle: Handle,
                                                       item_referent: CString,
                                                       count: usize,
                                                       cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_close_credentials_search_for_proof_req(command_handle: Handle,
                                                              search_handle: Handle,
                                                              cb: Option<ResponseEmptyCB>) -> Error;

    #[no_mangle]
    pub fn indy_prover_create_proof(command_handle: Handle,
                                    wallet_handle: Handle,
                                    proof_req_json: CString,
                                    requested_credentials_json: CString,
                                    master_secret_id: CString,
                                    schemas_json: CString,
                                    credential_defs_json: CString,
                                    rev_states_json: CString,
                                    cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_verifier_verify_proof(command_handle: Handle,
                                      proof_request_json: CString,
                                      proof_json: CString,
                                      schemas_json: CString,
                                      credential_defs_json: CString,
                                      rev_reg_defs_json: CString,
                                      rev_regs_json: CString,
                                      cb: Option<ResponseBoolCB>) -> Error;

    #[no_mangle]
    pub fn indy_create_revocation_state(command_handle: Handle,
                                        blob_storage_reader_handle: Handle,
                                        rev_reg_def_json: CString,
                                        rev_reg_delta_json: CString,
                                        timestamp: u64,
                                        cred_rev_id: CString,
                                        cb: Option<ResponseStringCB>) -> Error;

    #[no_mangle]
    pub fn indy_update_revocation_state(command_handle: Handle,
                                        blob_storage_reader_handle: Handle,
                                        rev_state_json: CString,
                                        rev_reg_def_json: CString,
                                        rev_reg_delta_json: CString,
                                        timestamp: u64,
                                        cred_rev_id: CString,
                                        cb: Option<ResponseStringCB>) -> Error;
}