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;
32pub mod session;
33pub mod settings;
34pub mod signer_list;
35pub mod verify;
36
37pub use binding::{
38 binding_env, binding_env_name, binding_env_with, check_own_binding, resolve_bindings,
39 BindingContext, Bindings, OwnBindingFacts,
40};
41pub use config::ConfigBody;
42pub use envelope::{Envelope, Kind, Opened, Role, Signature, SignedStatement};
43pub use error::{ErrorData, Result};
44pub use key::{PublicKey, SecretKey, PUBLIC_KEY_PREFIX};
45pub use ledger::{Entry, Ledger};
46pub use recovery::RecoveryCode;
47pub use release::{
48 build_workload, BuiltWorkload, LocalValues, ReleaseBody, SetupTemplate, Workload,
49 WorkloadRequest,
50};
51pub use settings::{candidate_prefixes, discover, InstallId, Lookup, SigningSettings};
52pub use signer_list::{
53 display_fingerprint, fingerprint, release_deny_entry, Keep, KeptKind, Signer, SignerChain,
54 SignerKind, SignerListBody, TrustedList, MAX_KEEP,
55};
56pub use verify::{Trust, Verified};
57
58impl SignedStatement {
59 pub fn sign_with(mut self, signer: &str, key: &SecretKey) -> Result<Self> {
61 let bytes = self.open()?.bytes;
62 self.signatures.push(Signature {
63 signer: signer.to_string(),
64 sig: key.sign(&bytes),
65 });
66 Ok(self)
67 }
68}