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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 the QSO Graph Trust contributors (see AUTHORS). Part of QSO Graph Trust; see LICENSE.
//! A read-only, public listing of a store folder, for programs that show what the store holds and
//! must not change it or reach its keys (QSO Graph Desktop's `lotw:read`).
//!
//! [`Store::open`](super::Store::open) is the wrong tool for that: it creates the folder and
//! `store.lock`, and checks every named credential, which on Windows reads the secret. [`Listing`]
//! takes only a path, so it has no credential backend to call, and holds nothing but public data.
//!
//! **Reading without the lock is safe.** Writers publish a complete `store.xml.partial` and rename
//! it over `store.xml` (`Store::replace`), so a reader sees the old file or the new, never a torn
//! one; the lock exists to serialise writers, which each reload under it. A listing is a snapshot
//! of the file as it was when read, and may be one write behind. On Windows, Rust's standard library
//! opens files sharing delete access, so a reader's open handle does not stop a writer's rename.
use Path;
use ;
use crateCertificate;
/// A certificate in the store, as a listing shows it. It carries no credential name.
///
/// There is no way to name the credential entry from a listing:
///
/// ```compile_fail,E0609
/// use qso_graph_trust::store::ListedCertificate;
/// fn name(c: &ListedCertificate) {
/// let _ = &c.key_name;
/// }
/// ```
/// The public contents of a store folder: its certificates and its trusted roots.
///
/// Reading it writes nothing (no folder, no `store.lock`, no file), takes no lock and never calls a
/// credential store, on any platform. A missing folder or `store.xml` is an empty store. A file the
/// full store refuses is refused with the same error, since both use one reader.
///
/// Reading a listing cannot be given a credential backend:
///
/// ```compile_fail,E0061
/// use qso_graph_trust::store::{KeyBackend, Listing};
/// let _ = Listing::read("folder", KeyBackend::Os);
/// ```