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, Signer, SignerChain, SignerKind, SignerListBody, TrustedList,
54};
55pub use verify::{Trust, Verified};
56
57impl SignedStatement {
58 pub fn sign_with(mut self, signer: &str, key: &SecretKey) -> Result<Self> {
60 let bytes = self.open()?.bytes;
61 self.signatures.push(Signature {
62 signer: signer.to_string(),
63 sig: key.sign(&bytes),
64 });
65 Ok(self)
66 }
67}