1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! VTA credential vault — the format-agnostic credential store
//! (`docs/05-design-notes/vti-credential-architecture.md` §5, task 1.1).
//!
//! This is the credential-architecture data plane the VTA grows in Phase 1:
//! it stores the W3C / SD-JWT-VC credentials a holder *holds* (invitations,
//! memberships, roles, endorsements, …), indexed so the holder's agent can
//! find them by `{type, community_did, issuer_did, purpose, status}` without
//! parsing every body.
//!
//! ## Not the password vault
//!
//! `vti_common::vault` is a *different* vault: the password-manager
//! `VaultEntry` records (site logins, OAuth tokens, passkeys) used by
//! Companions to authenticate against external sites. Both stores share the
//! single `vault` keyspace but use disjoint key namespaces:
//!
//! | Namespace | Owner | Holds |
//! |-----------|-------|-------|
//! | `vault:<id>` | `vti_common::vault` | password-manager `VaultEntry` |
//! | `cred:<id>` | this module | `StoredCredential` (the body, encrypted) |
//! | `idx:<field>:…` | this module | credential secondary index (key-only) |
//!
//! ## Scope of task 1.1 (and what is deliberately absent)
//!
//! The **storage** layer ([`storage`], [`index`], [`model`]) is
//! format-agnostic and does **no cryptography**: it stores opaque credential
//! bodies plus an indexed metadata envelope, with encryption-at-rest
//! delegated to the keyspace's AES-256-GCM wrapper. The **receive** layer
//! ([`receive`], task 1.2) sits on top of it: it verifies an incoming
//! SD-JWT-VC minimally (issuer signature + temporal validity), maps it into a
//! [`StoredCredential`], and stores + indexes it through the storage layer.
//! The **query** layer ([`query`], task 1.3) is the local DCQL-shaped search:
//! it returns descriptors (never bodies) for credentials matching an explicit
//! filter. The **mint** layer ([`mint`], task 1.5) is the issue path: the VTA
//! signs its *own* SD-JWT-VC (selected claims selectively disclosable, holder
//! key bound as `cnf`) through a sign-only signer abstraction, never exporting
//! the issuer key. The **present** layer ([`present`], task 1.4) is the
//! consent-gated disclosure path: it loads a stored SD-JWT-VC + a signed
//! consent record, gates disclosure on [`consent::authorizes`], refuses any
//! revoked / temporally-invalid credential, and emits a selectively-disclosed
//! presentation revealing **only** the consented claims plus a mandatory holder
//! `kb-jwt`. Still to come: resolve status lists (1.6).
//!
//! It also exposes **no wallet-enumeration primitive** — there is no
//! `list_all`. The only discovery path is [`storage::find_by_index`], which
//! requires an explicit indexed field *and* value. This is the storage-layer
//! expression of the no-enumeration invariant
//! (`vti-credential-architecture.md` §14); the route/operation layers built
//! on top in later tasks must preserve it (DCQL-targeted discovery only,
//! never "return the whole set").
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;