pub struct PersistedAlbum {
pub album_id: Uuid,
pub name: String,
pub amks: Vec<AmkRow>,
pub current_epoch: u32,
pub write_tier_seed64: Option<ByteBuf>,
pub admin_seed64: Option<ByteBuf>,
pub authority: Option<PersistedAuthority>,
}Expand description
One album’s persisted key material.
Fields§
§album_id: UuidAlbum id.
name: StringDisplay name.
amks: Vec<AmkRow>The AMK ledger: one (album_id, epoch, amk) row per epoch, kept sorted by epoch.
current_epoch: u32The current (highest) epoch — the one new writes are authored under.
write_tier_seed64: Option<ByteBuf>The per-album write-tier signing key’s 64-byte hybrid seed (Ed25519 ‖ ML-DSA-65).
None for an album recovered from a backup artifact, which escrows no write capability.
admin_seed64: Option<ByteBuf>The per-album admin signing key’s 64-byte hybrid seed. None as above.
The attested authority state. For a backup-recovered album, the public ledger the artifact
carried, or None when it carried none.
Implementations§
Source§impl PersistedAlbum
impl PersistedAlbum
Sourcepub fn recovered(
album_id: Uuid,
name: &str,
amks: Vec<AmkRow>,
authority: Option<PersistedAuthority>,
) -> Self
pub fn recovered( album_id: Uuid, name: &str, amks: Vec<AmkRow>, authority: Option<PersistedAuthority>, ) -> Self
A read-only album entry: escrowed AMKs and, when the artifact carried one, the album’s public authority — but no write or admin capability. This is what a backup restore can honestly reconstruct.
Sourcepub fn held_epochs(&self) -> BTreeSet<u32>
pub fn held_epochs(&self) -> BTreeSet<u32>
The epochs whose AMK content key this device holds — the input that restores a reference
authority’s local-only amk_present flags.
Sourcepub fn write_tier_key(
&self,
) -> Result<Option<HybridSigningKey>, AlbumStoreError>
pub fn write_tier_key( &self, ) -> Result<Option<HybridSigningKey>, AlbumStoreError>
Decode the write-tier signing key, if this album carries write capability.
Sourcepub fn admin_key(&self) -> Result<Option<HybridSigningKey>, AlbumStoreError>
pub fn admin_key(&self) -> Result<Option<HybridSigningKey>, AlbumStoreError>
Decode the admin signing key, if this album carries admin capability.
Sourcepub fn seal_escrow(
&self,
master: &MasterKey,
) -> Result<Vec<u8>, AlbumStoreError>
pub fn seal_escrow( &self, master: &MasterKey, ) -> Result<Vec<u8>, AlbumStoreError>
This album’s server-side key escrow: its canonical CBOR behind
a versioned domain separator, sealed under the account master key with
MasterKey::seal.
Everything the album holds travels — every epoch’s AMK, the write-tier and admin seeds,
and the authority — so a device recovered from the master key alone holds the album as
the device that escrowed it did. It adds no root: only the master key opens it, and the
master key already opens the keystore file this is a slice of. The seal draws a fresh
nonce, so two escrows of one state differ in their bytes;
escrow_matches compares what they open to.
§Errors
AlbumStoreError::Cbor when the album does not encode.
Sourcepub fn open_escrow(
blob: &[u8],
master: &MasterKey,
album_id: Uuid,
) -> Result<Self, AlbumStoreError>
pub fn open_escrow( blob: &[u8], master: &MasterKey, album_id: Uuid, ) -> Result<Self, AlbumStoreError>
Open an album key escrow seal_escrow produced, served under
album_id.
§Errors
AlbumStoreError::Crypto when the master key does not open it (another account’s, or
tampered), AlbumStoreError::NotAnAlbumKeyEscrow when it opens but is another kind of
sealed blob, AlbumStoreError::Cbor when it does not decode, and
AlbumStoreError::EscrowAlbumMismatch when it holds an album other than album_id.
Sourcepub fn escrow_matches(&self, blob: &[u8], master: &MasterKey) -> bool
pub fn escrow_matches(&self, blob: &[u8], master: &MasterKey) -> bool
Whether blob is an escrow of exactly this album’s current state: it opens under
master as this album, and what it holds encodes to the same canonical bytes. Any
failure to open is false.
Sourcepub fn escrow_coverage(&self, blob: &[u8], master: &MasterKey) -> EscrowCoverage
pub fn escrow_coverage(&self, blob: &[u8], master: &MasterKey) -> EscrowCoverage
How the escrow blob the server holds for this album stands against this album’s
state — and so whether replacing it with this album’s escrow can only add to it.
The comparison is per epoch: an escrow is never replaced by one that lacks an epoch it
holds, or that holds a different key for an epoch they share, because a recovery from the
replacement would lose that epoch’s assets. Nor is it replaced by one that lacks a
write-tier seed, admin seed or authority it holds: a read-only device (one restored from a
backup) would otherwise strip the capability every later recovery depends on. See
EscrowCoverage.
Trait Implementations§
Source§impl Clone for PersistedAlbum
impl Clone for PersistedAlbum
Source§fn clone(&self) -> PersistedAlbum
fn clone(&self) -> PersistedAlbum
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PersistedAlbum
impl Debug for PersistedAlbum
Source§impl<'de> Deserialize<'de> for PersistedAlbum
impl<'de> Deserialize<'de> for PersistedAlbum
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PersistedAlbum
impl RefUnwindSafe for PersistedAlbum
impl Send for PersistedAlbum
impl Sync for PersistedAlbum
impl Unpin for PersistedAlbum
impl UnsafeUnpin for PersistedAlbum
impl UnwindSafe for PersistedAlbum
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more