@tauri-apps/plugin-stronghold
Classes
Client
Constructors
constructor()
new Client(path, name): ClientParameters
| Parameter | Type |
|---|---|
path | string |
name | ClientPath |
Returns
Source: index.ts:275
Properties
| Property | Type |
|---|---|
name | BytesDto |
path | string |
Methods
getStore()
getStore(): StoreReturns
Source: index.ts:290
getVault()
getVault(name): VaultGet a vault by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | VaultPath |
Returns
Source: index.ts:286
Location
Constructors
constructor()
new Location(type, payload): LocationParameters
| Parameter | Type |
|---|---|
type | string |
payload | Record< string, unknown > |
Returns
Source: index.ts:96
Properties
| Property | Type |
|---|---|
payload | Record< string, unknown > |
type | string |
Methods
counter()
static counter(vault, counter): LocationParameters
| Parameter | Type |
|---|---|
vault | VaultPath |
counter | number |
Returns
Source: index.ts:108
generic()
static generic(vault, record): LocationParameters
| Parameter | Type |
|---|---|
vault | VaultPath |
record | RecordPath |
Returns
Source: index.ts:101
Store
Constructors
constructor()
new Store(path, client): StoreParameters
| Parameter | Type |
|---|---|
path | string |
client | BytesDto |
Returns
Source: index.ts:299
Properties
| Property | Type |
|---|---|
client | BytesDto |
path | string |
Methods
get()
get(key): Promise< null | Uint8Array >Parameters
| Parameter | Type |
|---|---|
key | StoreKey |
Returns
Promise< null | Uint8Array >
Source: index.ts:304
insert()
insert( key, value, lifetime?): Promise< void >Parameters
| Parameter | Type |
|---|---|
key | StoreKey |
value | number[] |
lifetime? | Duration |
Returns
Promise< void >
Source: index.ts:312
remove()
remove(key): Promise< null | Uint8Array >Parameters
| Parameter | Type |
|---|---|
key | StoreKey |
Returns
Promise< null | Uint8Array >
Source: index.ts:326
Stronghold
A representation of an access to a stronghold.
Constructors
constructor()
private new Stronghold(path): StrongholdInitializes a stronghold.
If the snapshot path located at path exists, the password must match.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns
Source: index.ts:406
Properties
| Property | Type |
|---|---|
path | string |
Methods
createClient()
createClient(client): Promise< Client >Parameters
| Parameter | Type |
|---|---|
client | ClientPath |
Returns
Source: index.ts:438
loadClient()
loadClient(client): Promise< Client >Parameters
| Parameter | Type |
|---|---|
client | ClientPath |
Returns
Source: index.ts:431
save()
save(): Promise< void >Persists the stronghold state to the snapshot.
Returns
Promise< void >
Source: index.ts:449
unload()
unload(): Promise< void >Remove this instance from the cache.
Returns
Promise< void >
Source: index.ts:425
load()
static load(path, password): Promise< Stronghold >Load the snapshot if it exists (password must match), or start a fresh stronghold instance otherwise.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | - |
password | string |
Returns
Source: index.ts:415
Vault
A key-value storage that allows create, update and delete operations. It does not allow reading the data, so one of the procedures must be used to manipulate the stored data, allowing secure storage of secrets.
Extends
ProcedureExecutor
Constructors
constructor()
new Vault( path, client, name): VaultParameters
| Parameter | Type |
|---|---|
path | string |
client | ClientPath |
name | VaultPath |
Returns
Overrides
ProcedureExecutor.constructor
Source: index.ts:350
Properties
| Property | Type | Description |
|---|---|---|
client | BytesDto | - |
name | BytesDto | The vault name. |
path | string | The vault path. |
procedureArgs | Record< string, unknown > | - |
Methods
deriveSLIP10()
deriveSLIP10( chain, source, sourceLocation, outputLocation): Promise< Uint8Array >Derive a SLIP10 private key using a seed or key.
Parameters
| Parameter | Type | Description |
|---|---|---|
chain | number[] | The chain path. |
source | "Seed" | "Key" | The source type, either ‘Seed’ or ‘Key’. |
sourceLocation | Location | The source location, must be the outputLocation of a previous call to generateSLIP10Seed or deriveSLIP10. |
outputLocation | Location | Location of the record where the private key will be stored. |
Returns
Inherited from
ProcedureExecutor.deriveSLIP10
Source: index.ts:155
generateBIP39()
generateBIP39(outputLocation, passphrase?): Promise< Uint8Array >Generate a BIP39 seed.
Parameters
| Parameter | Type | Description |
|---|---|---|
outputLocation | Location | The location of the record where the BIP39 seed will be stored. |
passphrase? | string | The optional mnemonic passphrase. |
Returns
Inherited from
ProcedureExecutor.generateBIP39
Source: index.ts:210
generateSLIP10Seed()
generateSLIP10Seed(outputLocation, sizeBytes?): Promise< Uint8Array >Generate a SLIP10 seed for the given location.
Parameters
| Parameter | Type | Description |
|---|---|---|
outputLocation | Location | Location of the record where the seed will be stored. |
sizeBytes? | number | The size in bytes of the SLIP10 seed. |
Returns
Inherited from
ProcedureExecutor.generateSLIP10Seed
Source: index.ts:130
getEd25519PublicKey()
getEd25519PublicKey(privateKeyLocation): Promise< Uint8Array >Gets the Ed25519 public key of a SLIP10 private key.
Since
2.0.0
Parameters
| Parameter | Type | Description |
|---|---|---|
privateKeyLocation | Location | The location of the private key. Must be the outputLocation of a previous call to deriveSLIP10. |
Returns
A promise resolving to the public key hex string.
Inherited from
ProcedureExecutor.getEd25519PublicKey
Source: index.ts:233
insert()
insert(recordPath, secret): Promise< void >Insert a record to this vault.
Parameters
| Parameter | Type |
|---|---|
recordPath | RecordPath |
secret | number[] |
Returns
Promise< void >
Source: index.ts:368
recoverBIP39()
recoverBIP39( mnemonic, outputLocation, passphrase?): Promise< Uint8Array >Store a BIP39 mnemonic.
Parameters
| Parameter | Type | Description |
|---|---|---|
mnemonic | string | The mnemonic string. |
outputLocation | Location | The location of the record where the BIP39 mnemonic will be stored. |
passphrase? | string | The optional mnemonic passphrase. |
Returns
Inherited from
ProcedureExecutor.recoverBIP39
Source: index.ts:185
remove()
remove(location): Promise< void >Remove a record from the vault.
Parameters
| Parameter | Type | Description |
|---|---|---|
location | Location | The record location. |
Returns
Promise< void >
Source: index.ts:384
signEd25519()
signEd25519(privateKeyLocation, msg): Promise< Uint8Array >Creates a Ed25519 signature from a private key.
Since
2.0.0
Parameters
| Parameter | Type | Description |
|---|---|---|
privateKeyLocation | Location | The location of the record where the private key is stored. Must be the outputLocation of a previous call to deriveSLIP10. |
msg | string | The message to sign. |
Returns
A promise resolving to the signature hex string.
Inherited from
ProcedureExecutor.signEd25519
Source: index.ts:254
Interfaces
AddressInfo
Properties
| Property | Type |
|---|---|
peers | Map< string, PeerAddress > |
relays | string[] |
ClientAccess
Properties
| Property | Type |
|---|---|
cloneVaultDefault? | boolean |
cloneVaultExceptions? | Map< VaultPath, boolean > |
readStore? | boolean |
useVaultDefault? | boolean |
useVaultExceptions? | Map< VaultPath, boolean > |
writeStore? | boolean |
writeVaultDefault? | boolean |
writeVaultExceptions? | Map< VaultPath, boolean > |
ConnectionLimits
Properties
| Property | Type |
|---|---|
maxEstablishedIncoming? | number |
maxEstablishedOutgoing? | number |
maxEstablishedPerPeer? | number |
maxEstablishedTotal? | number |
maxPendingIncoming? | number |
maxPendingOutgoing? | number |
Duration
A duration definition.
Properties
NetworkConfig
Properties
| Property | Type |
|---|---|
addresses? | AddressInfo |
connectionTimeout? | Duration |
connectionsLimit? | ConnectionLimits |
enableMdns? | boolean |
enableRelay? | boolean |
peerPermissions? | Map< string, Permissions > |
permissionsDefault? | Permissions |
requestTimeout? | Duration |
PeerAddress
Properties
| Property | Type |
|---|---|
known | string[] |
use_relay_fallback | boolean |
Permissions
Properties
| Property | Type |
|---|---|
default? | ClientAccess |
exceptions? | Map< VaultPath, ClientAccess > |
Type Aliases
ClientPath
ClientPath: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;Source: index.ts:8
RecordPath
RecordPath: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;Source: index.ts:18
StoreKey
StoreKey: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;Source: index.ts:23
VaultPath
VaultPath: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;Source: index.ts:13
© 2024 Tauri Contributors. CC-BY / MIT