AgentBackup
@hyperledger/identus-sdk v8.0.0
@hyperledger/identus-sdk / overview / AgentBackup
Class: AgentBackup
Defined in: packages/lib/sdk/src/edge-agent/Agent.Backup.ts:12
Constructors
Constructor
new AgentBackup(
Agent:Agent):AgentBackup
Defined in: packages/lib/sdk/src/edge-agent/Agent.Backup.ts:13
Parameters
| Parameter | Type |
|---|---|
Agent | Agent |
Returns
AgentBackup
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
Agent | readonly | Agent | packages/lib/sdk/src/edge-agent/Agent.Backup.ts:14 |
Methods
createJWE()
createJWE(
options?:BackupOptions):Promise<string>
Defined in: packages/lib/sdk/src/edge-agent/Agent.Backup.ts:33
Creates a JWE (JSON Web Encryption) containing the backup data stored in Pluto. The data can optionally be encrypted using a custom master key, compressed, and filtered to exclude specified fields.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | BackupOptions | Optional settings for the backup. |
Returns
Promise<string>
- A promise that resolves to the JWE string.
See
restore - Method to restore data from a JWE string.
restore()
restore(
jwe:string,options?:BackupOptions):Promise<void>
Defined in: packages/lib/sdk/src/edge-agent/Agent.Backup.ts:67
Decodes a JWE (JSON Web Encryption) string and restores the backup data to the store. If the JWE is compressed (Base64-encoded), it will attempt to decompress it first.
Parameters
| Parameter | Type | Description |
|---|---|---|
jwe | string | The JWE string containing the encrypted backup data. |
options? | BackupOptions | Optional settings for the backup. |
Returns
Promise<void>
- A promise that resolves when the data is successfully restored.
See
createJWE - Method to create a JWE from the stored backup data.