Skip to main content

Crate gman

Crate gman 

Source
Expand description

Gman core library

This crate provides two layers:

  • A small crypto helper API for envelope encrypting/decrypting strings.
  • Public modules for configuration and secret providers used by the CLI.

Quick start for the crypto helpers:

use gman::{encrypt_string, decrypt_string};
use secrecy::SecretString;

let password = SecretString::new("correct horse battery staple".into());
let ciphertext = encrypt_string(password.clone(), "swordfish").unwrap();
let plaintext = decrypt_string(password, &ciphertext).unwrap();

assert_eq!(plaintext, "swordfish");

The config and providers modules power the CLI. They can be embedded in other programs, but many functions interact with the user or the filesystem. Prefer no_run doctests for those.

Re-exports§

pub use providers::SecretError;
pub use providers::SyncError;

Modules§

config
Configuration structures and helpers used by the CLI and library. Application configuration and run-profile validation.
providers
Secret provider trait and implementations. Secret provider trait and registry.

Functions§

decrypt_string
Decrypt an envelope produced by encrypt_string.
encrypt_string
Encrypt a UTF‑8 string using a password and return a portable envelope.