Class VaultSnapshot
java.lang.Object
lol.trq.alts.vault.VaultSnapshot
What one member device keeps of a repository between runs, for the host to persist and pass back to
SharedVault.resume(VaultHost, OwnerIdentity, VaultSnapshot): the verified chain as its state hashes, whose last is the pin a rollback must not go
below (AVP SPEC 6.4); every data key this device has held, by epoch, so old-epoch heads stay readable; the
clock (SPEC 5); the merged payload; whether this member left; the member it belongs to; and its home host,
key and locator, so VaultHosts.connect(VaultSnapshot) reaches it by key.
It names the member by its member id and does not hold the identity: the host keeps the identity on its
own (WrappedIdentity for a member, OwnerIdentity.entropy() for the owner) and passes it to
resume, which refuses an identity that is not the one named here.
It holds secrets (the data keys and the accounts' credentials), so persist its toJson()
encrypted, for example in HostSecrets, never in plain text. toString()
shows neither.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic VaultSnapshotReads a snapshot from its JSON form.homeHost()The member's home host, by key;VaultHosts.connect(VaultSnapshot)reaches it.booleanleft()Whether this member left the repository; such a snapshot does not resume.memberId()The member this snapshot belongs to.longThe seq of the pinned state, the highest this device verified.repoId()The repository.toJson()The JSON form to persist.toString()The repository, the pin and counts only; never a key or an account.
-
Method Details
-
toJson
-
fromJson
Reads a snapshot from its JSON form.- Parameters:
json- whattoJson()returned- Returns:
- the snapshot
- Throws:
AltsException- of kindINVALID_INPUTif the text is not a snapshot of this version- Since:
- 1.0.0
-
repoId
-
memberId
-
homeHost
The member's home host, by key;VaultHosts.connect(VaultSnapshot)reaches it.- Returns:
- the home host
- Since:
- 1.0.0
-
pinnedSeq
public long pinnedSeq()The seq of the pinned state, the highest this device verified.- Returns:
- the seq
- Since:
- 1.0.0
-
left
public boolean left()Whether this member left the repository; such a snapshot does not resume.- Returns:
- whether it left
- Since:
- 1.0.0
-
toString
-