dugout 0.1.8

Git-native secrets manager for development teams, written in Rust
Documentation
//! Cryptographic operations.
//!
//! Two backends:
//! - **age** (default): x25519 public-key encryption
//! - **hybrid**: age + cloud KMS (AWS or GCP)
//!
//! Cloud KMS implementations live in `envelope.rs`, `aws.rs`, `gcp.rs`.

use crate::error::Result;

mod age;
mod backend;
pub mod envelope;

#[cfg(feature = "aws")]
pub mod aws;

#[cfg(feature = "gcp")]
pub mod gcp;

pub use age::{parse_recipient, Age};
pub use backend::CipherBackend;
#[allow(unused_imports)]
pub use envelope::{Envelope, KmsProvider};

/// Cryptographic backend trait.
pub trait Cipher {
    type Recipient;
    type Identity;

    fn encrypt(&self, plaintext: &str, recipients: &[Self::Recipient]) -> Result<String>;
    fn decrypt(&self, encrypted: &str, identity: &Self::Identity) -> Result<String>;
    fn name(&self) -> &'static str;
}