VaultSubscription
Hive SDK needs to interact with the remote Vault Service through the Vault instance. Users subscribe to the trusted Hive Node to create Vault Service in advance, and then they can access the application data to the corresponding Vault.
VaultSubscription class is used to create a Vault Service by subscription, and the Hive Node service creates a new Vault Service according to the DID identity of the requester. If the Vault Service based on the DID identity already exists, the existing Vault Service metadata will be returned.
Example
Use the vaultSubscription instance to create a new Vault Service in the trusted Hive Node subscription and return a CompletableFuture object containing the metadata information of the subscribed remote Vault Service. The actual sample code is as follows:
Once the subscription is successful, the instantiation object vault can be used to access the application data.
Subscription Management
Check Subscription
After subscribing to the trusted Hive Node, the user can use the vault instance to access the data in the application, or view the information of the corresponding Vault Service by using the following interface.
Unsubscription
Users can use the Vault Service for a period and migrate the already used Vault Service to the new Hive Node as needed. After the migration, it is necessary to stop the Vault Service on the original Hive Node and destroy the data within.
Attention: after calling this interface to cancel the vault Service, the data held in the vault will be permanently deleted from the corresponding Hive Node, and the Vault Service will stop serving as well. The user must ensure that a new Vault service has been migrated before calling this interface to cancel the vault service.
Last updated