[team] Team vaults: member keys, member slots (kind 6), policies per environment, the canonical sign.request, approval statements, policy proofs; cosign and Tauri updater envelopes; v0.18.0
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
//! The one interface an external signer is reached through (docs/TEAM.md, Authenticode). A hardware token or a
|
||||
//! cloud signing service holds the private key; Custos approves, then hands the adapter the digest and the
|
||||
//! credential that lets it ask. Adapters are the app's (I/O); this crate only names the shape.
|
||||
|
||||
use std::fmt;
|
||||
|
||||
/// The credential an adapter uses, borrowed from the team vault for one call. Prints `[redacted]` for `secret`.
|
||||
pub struct SignerCredential<'a> {
|
||||
pub id: &'a str,
|
||||
pub name: &'a str,
|
||||
/// Which adapter: `command` in this phase.
|
||||
pub adapter: &'a str,
|
||||
pub endpoint: &'a str,
|
||||
pub account: &'a str,
|
||||
pub secret: &'a str,
|
||||
}
|
||||
|
||||
impl fmt::Debug for SignerCredential<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SignerCredential")
|
||||
.field("id", &self.id)
|
||||
.field("adapter", &self.adapter)
|
||||
.field("endpoint", &self.endpoint)
|
||||
.field("secret", &"[redacted]")
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
/// Signs a 32-byte SHA-256 digest (signtool's `.dig`) with a key Custos never holds: returns the raw signature
|
||||
/// (RSA PKCS#1 v1.5 over the SHA-256 DigestInfo, as `signtool sign /di` wants it). An error names what failed,
|
||||
/// never the credential.
|
||||
pub trait ExternalSigner {
|
||||
fn sign_digest(&self, signer: &SignerCredential<'_>, digest: &[u8; 32]) -> Result<Vec<u8>, String>;
|
||||
}
|
||||
Reference in New Issue
Block a user