@@ -137,34 +137,42 @@ public static CompletableFuture<Void> registerWalletType(
137137 /**
138138 * Creates a new secure wallet with the given unique name.
139139 *
140- * @param poolName Name of the pool that corresponds to this wallet.
141- * @param name Name of the wallet.
142- * @param xtype Type of the wallet. Defaults to 'default'.
143- * @param config Wallet configuration json. List of supported keys are defined by wallet type.
144- * @param credentials Wallet credentials json: {
145- * "key": <string>
140+ * @param config Wallet configuration json.
141+ * {
142+ * "id": string, Identifier of the wallet.
143+ * Configured storage uses this identifier to lookup exact wallet data placement.
144+ * "storage_type": optional<string>, Type of the wallet storage. Defaults to 'default'.
145+ * 'Default' storage type allows to store wallet data in the local file.
146+ * Custom storage types can be registered with indy_register_wallet_storage call.
147+ * "storage_config": optional<object>, Storage configuration json. Storage type defines set of supported keys.
148+ * Can be optional if storage supports default configuration.
149+ * For 'default' storage type configuration is:
150+ * {
151+ * "path": optional<string>, Path to the directory with wallet files.
152+ * Defaults to $HOME/.indy_client/wallets.
153+ * Wallet will be stored in the file {path}/{id}/sqlite.db
154+ * }
155+ * }
156+ * @param credentials Wallet credentials json
157+ * {
158+ * "key": string, Passphrase used to derive wallet master key
159+ * "storage_credentials": optional<object> Credentials for wallet storage. Storage type defines set of supported keys.
160+ * Can be optional if storage supports default configuration.
161+ * For 'default' storage type should be empty.
162+ *
146163 * }
147164 * @return A future that resolves no value.
148165 * @throws IndyException Thrown if a call to the underlying SDK fails.
149166 */
150167 public static CompletableFuture <Void > createWallet (
151- String poolName ,
152- String name ,
153- String xtype ,
154168 String config ,
155169 String credentials ) throws IndyException {
156170
157- ParamGuard .notNullOrWhiteSpace (poolName , "poolName" );
158- ParamGuard .notNullOrWhiteSpace (name , "name" );
159-
160171 CompletableFuture <Void > future = new CompletableFuture <Void >();
161172 int commandHandle = addFuture (future );
162173
163174 int result = LibIndy .api .indy_create_wallet (
164175 commandHandle ,
165- poolName ,
166- name ,
167- xtype ,
168176 config ,
169177 credentials ,
170178 voidCb );
@@ -177,28 +185,46 @@ public static CompletableFuture<Void> createWallet(
177185 /**
178186 * Opens the wallet with specific name.
179187 *
180- * @param name Name of the wallet.
181- * @param runtimeConfig Runtime wallet configuration json. if NULL, then default runtime_config will be used.
182- * @param credentials Wallet credentials json: {
183- * "key": <string>
188+ * @param config Wallet configuration json.
189+ * {
190+ * "id": string, Identifier of the wallet.
191+ * Configured storage uses this identifier to lookup exact wallet data placement.
192+ * "storage_type": optional<string>, Type of the wallet storage. Defaults to 'default'.
193+ * 'Default' storage type allows to store wallet data in the local file.
194+ * Custom storage types can be registered with indy_register_wallet_storage call.
195+ * "storage_config": optional<object>, Storage configuration json. Storage type defines set of supported keys.
196+ * Can be optional if storage supports default configuration.
197+ * For 'default' storage type configuration is:
198+ * {
199+ * "path": optional<string>, Path to the directory with wallet files.
200+ * Defaults to $HOME/.indy_client/wallets.
201+ * Wallet will be stored in the file {path}/{id}/sqlite.db
202+ * }
184203 * }
204+ * @param credentials Wallet credentials json
205+ * {
206+ * "key": string, Passphrase used to derive current wallet master key
207+ * "rekey": optional<string>, If present than wallet master key will be rotated to a new one
208+ * derived from this passphrase.
209+ * "storage_credentials": optional<object> Credentials for wallet storage. Storage type defines set of supported keys.
210+ * Can be optional if storage supports default configuration.
211+ * For 'default' storage type should be empty.
212+ *
213+ * }
185214 * @return A future that resolves no value.
186215 * @throws IndyException Thrown if a call to the underlying SDK fails.
187216 */
188217 public static CompletableFuture <Wallet > openWallet (
189- String name ,
190- String runtimeConfig ,
218+ String config ,
191219 String credentials ) throws IndyException {
192220
193- ParamGuard .notNullOrWhiteSpace (name , "name" );
194221
195222 CompletableFuture <Wallet > future = new CompletableFuture <Wallet >();
196223 int commandHandle = addFuture (future );
197224
198225 int result = LibIndy .api .indy_open_wallet (
199226 commandHandle ,
200- name ,
201- runtimeConfig ,
227+ config ,
202228 credentials ,
203229 openWalletCb );
204230
@@ -237,25 +263,46 @@ private static CompletableFuture<Void> closeWallet(
237263 /**
238264 * Deletes an existing wallet.
239265 *
240- * @param name Name of the wallet to delete.
241- * @param credentials Wallet credentials json: {
242- * "key": <string>
266+ * @param config Wallet configuration json.
267+ * {
268+ * "id": string, Identifier of the wallet.
269+ * Configured storage uses this identifier to lookup exact wallet data placement.
270+ * "storage_type": optional<string>, Type of the wallet storage. Defaults to 'default'.
271+ * 'Default' storage type allows to store wallet data in the local file.
272+ * Custom storage types can be registered with indy_register_wallet_storage call.
273+ * "storage_config": optional<object>, Storage configuration json. Storage type defines set of supported keys.
274+ * Can be optional if storage supports default configuration.
275+ * For 'default' storage type configuration is:
276+ * {
277+ * "path": optional<string>, Path to the directory with wallet files.
278+ * Defaults to $HOME/.indy_client/wallets.
279+ * Wallet will be stored in the file {path}/{id}/sqlite.db
280+ * }
243281 * }
282+ * @param credentials Wallet credentials json
283+ * {
284+ * "key": string, Passphrase used to derive current wallet master key
285+ * "rekey": optional<string>, If present than wallet master key will be rotated to a new one
286+ * derived from this passphrase.
287+ * "storage_credentials": optional<object> Credentials for wallet storage. Storage type defines set of supported keys.
288+ * Can be optional if storage supports default configuration.
289+ * For 'default' storage type should be empty.
290+ *
291+ * }
292+ *
244293 * @return A future that resolves no value.
245294 * @throws IndyException Thrown if a call to the underlying SDK fails.
246295 */
247296 public static CompletableFuture <Void > deleteWallet (
248- String name ,
297+ String config ,
249298 String credentials ) throws IndyException {
250299
251- ParamGuard .notNullOrWhiteSpace (name , "name" );
252-
253300 CompletableFuture <Void > future = new CompletableFuture <Void >();
254301 int commandHandle = addFuture (future );
255302
256303 int result = LibIndy .api .indy_delete_wallet (
257304 commandHandle ,
258- name ,
305+ config ,
259306 credentials ,
260307 voidCb );
261308
@@ -272,8 +319,8 @@ public static CompletableFuture<Void> deleteWallet(
272319 * @param wallet The wallet to export.
273320 * @param exportConfigJson: JSON containing settings for input operation.
274321 * {
275- * "path": path of the file that contains exported wallet content
276- * "key": passphrase used to export key
322+ * "path": <string>, Path of the file that contains exported wallet content
323+ * "key": <string>, Passphrase used to derive export key
277324 * }
278325 * @return A future that resolves no value.
279326 * @throws IndyException Thrown if a call to the underlying SDK fails.
@@ -308,40 +355,47 @@ public static CompletableFuture<Void> exportWallet(
308355 *
309356 * Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
310357 * the future releases.
311- * @param poolName Name of the pool that corresponds to this wallet.
312- * @param name Name of the wallet.
313- * @param xtype Type of the wallet. Defaults to 'default'.
358+ *
314359 * @param config Wallet configuration json. List of supported keys are defined by wallet type.
315- * @param credentials Wallet credentials json: {
316- * "key": <string>
317- * }
318- * @param importConfigJson JSON containing settings for input operation: {
319- * "path": path of the file that contains exported wallet content
320- * "key": passphrase used to export key
360+ * @param credentials Wallet configuration json.
361+ * {
362+ * "id": string, Identifier of the wallet.
363+ * Configured storage uses this identifier to lookup exact wallet data placement.
364+ * "storage_type": optional<string>, Type of the wallet storage. Defaults to 'default'.
365+ * 'Default' storage type allows to store wallet data in the local file.
366+ * Custom storage types can be registered with indy_register_wallet_storage call.
367+ * "storage_config": optional<object>, Storage configuration json. Storage type defines set of supported keys.
368+ * Can be optional if storage supports default configuration.
369+ * For 'default' storage type configuration is:
370+ * {
371+ * "path": optional<string>, Path to the directory with wallet files.
372+ * Defaults to $HOME/.indy_client/wallets.
373+ * Wallet will be stored in the file {path}/{id}/sqlite.db
321374 * }
375+ * }
376+ * @param importConfigJson Wallet credentials json
377+ * {
378+ * "key": string, Passphrase used to derive wallet master key
379+ * "storage_credentials": optional<object> Credentials for wallet storage. Storage type defines set of supported keys.
380+ * Can be optional if storage supports default configuration.
381+ * For 'default' storage type should be empty.
382+ *
383+ * }
322384 * @return A future that resolves no value.
323385 * @throws IndyException Thrown if a call to the underlying SDK fails.
324386 */
325387 public static CompletableFuture <Void > importWallet (
326- String poolName ,
327- String name ,
328- String xtype ,
329388 String config ,
330389 String credentials ,
331390 String importConfigJson ) throws IndyException {
332391
333- ParamGuard .notNullOrWhiteSpace (poolName , "poolName" );
334- ParamGuard .notNullOrWhiteSpace (name , "name" );
335392 ParamGuard .notNull (importConfigJson , "importConfigJson" );
336393
337394 CompletableFuture <Void > future = new CompletableFuture <Void >();
338395 int commandHandle = addFuture (future );
339396
340397 int result = LibIndy .api .indy_import_wallet (
341398 commandHandle ,
342- poolName ,
343- name ,
344- xtype ,
345399 config ,
346400 credentials ,
347401 importConfigJson ,
0 commit comments