Skip to main content

Crate armoire

Crate armoire 

Source
Expand description

Cross-platform utilities for credentials, password generation, and secure secret storage.

§Modules

§Example

use armoire::{
    passwords::{Characters, Generator},
    secrets::Secret,
    Credential,
};

fn main() {
    let credential = Credential::builder()
        .name("Example Service".to_string())
        .username("alice".to_string())
        .password("super-secret-password".to_string())
        .url("https://example.com/login".to_string())
        .build()
        .expect("all required credential fields should be present");

    let generator = Generator::new(
        Characters::LOWERCASE | Characters::UPPERCASE | Characters::NUMERIC,
    );
    let generated_password = generator.generate(24);

    let api_secret = Secret::new("example_api_key".to_string(), "key-123".to_string());

    assert_eq!(credential.name(), "Example Service");
    assert_eq!(generated_password.len(), 24);
    assert_eq!(api_secret.name(), "example_api_key");
}

Modules§

passwords
Random password generation with configurable character classes.
secrets
Secure storage of secret name/value pairs using the operating system’s native credential store.

Structs§

Credential
A single stored login credential.
CredentialBuilder
Builder for Credential.

Enums§

CredentialBuilderError
Errors returned by CredentialBuilder::build.