1#![expect(
20 clippy::result_large_err,
21 reason = "Alien errors retain structured metadata and causal context"
22)]
23
24pub mod binding;
25pub mod config;
26pub mod envelope;
27pub mod error;
28pub mod key;
29pub mod ledger;
30pub mod recovery;
31pub mod release;
32#[cfg(not(target_arch = "wasm32"))]
33pub mod session;
34pub mod settings;
35pub mod signer_list;
36pub mod verify;
37
38pub use binding::{
39 binding_env, binding_env_name, binding_env_with, check_own_binding, resolve_bindings,
40 BindingContext, Bindings, OwnBindingFacts,
41};
42pub use config::ConfigBody;
43pub use envelope::{Envelope, Kind, Opened, Role, Signature, SignedStatement};
44pub use error::{ErrorData, Result};
45pub use key::{PublicKey, SecretKey, PUBLIC_KEY_PREFIX};
46pub use ledger::{Entry, Ledger};
47pub use recovery::RecoveryCode;
48pub use release::{
49 build_workload, BuiltWorkload, LocalValues, ReleaseBody, SetupTemplate, Workload,
50 WorkloadRequest,
51};
52pub use settings::{candidate_prefixes, discover, InstallId, Lookup, SigningSettings};
53pub use signer_list::{
54 display_fingerprint, fingerprint, release_deny_entry, Keep, KeptKind, Signer, SignerChain,
55 SignerKind, SignerListBody, TrustedList, MAX_KEEP,
56};
57pub use verify::{Trust, Verified};
58
59impl SignedStatement {
60 pub fn sign_with(mut self, signer: &str, key: &SecretKey) -> Result<Self> {
62 let bytes = self.open()?.bytes;
63 self.signatures.push(Signature {
64 signer: signer.to_string(),
65 sig: key.sign(&bytes),
66 });
67 Ok(self)
68 }
69}