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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//! Transport-level credential bundle for outbound connections:
//! [`ConnectionCredentials`], [`RemoteIdentity`] (ADR-005, moved from
//! alknet-core `credentials.rs`; alknet ADR-091's semantics).
//!
//! [`ConnectionCredentials`] carries the two dimensions the client config
//! consumes: the local node's identity and the expected remote identity.
//! It is transport-agnostic — consumed by this crate's
//! [`TlsClientConfig`](crate::TlsClientConfig) (TLS setup) and by the dial
//! seam in the consumers.
use crateTlsIdentity;
/// Expected identity of the remote node (alknet ADR-017 §7, extended by
/// alknet ADR-034 §2; ADR-005 moved the type here).
///
/// Carries a fingerprint string the assembly layer derives when the local
/// node knows the remote (the known-peer case → fingerprint pin).
///
/// `remote_identity: None` is the **public X.509 endpoint** case: the local
/// node has no prior knowledge of the remote, so there is no fingerprint to
/// pin. Combined with an X.509 remote, `None` selects CA verification
/// ([`WebPkiServerVerifier`] per the verifier-selection rule in alknet
/// ADR-034 §3). Combined with an Ed25519 raw-key remote, `None` fails closed
/// at handshake (raw-key remotes are always known peers — no CA to fall
/// back to).
///
/// The `Option` is therefore load-bearing, not cosmetic:
/// `Some(fingerprint)` means "pin this" (known peer), `None` means "trust
/// the CA or fail" (unknown remote). An implementer must not default
/// `remote_identity` to a placeholder value to "satisfy" the field — `None`
/// is a real state that drives verifier selection.
///
/// [`WebPkiServerVerifier`]: rustls::client::WebPkiServerVerifier
/// Credentials for an outbound connection (alknet ADR-091's semantics,
/// ADR-005 moved the type here). All dimensions come from the assembly
/// layer's configuration — never from environment variables.
///
/// The two `Option`s are the two credential dimensions the client config
/// consumes (see `docs/architecture/client.md`): the client-auth
/// presentation (`local_identity`) and the verifier selection
/// (`remote_identity`). Both are load-bearing, not cosmetic — `Some` means
/// "pin this", `None` means "trust the CA or fail", never a placeholder
/// default.