aes-config-rs

The rust project config with aes encrypt function

usage

cmd

You can pass all parameters through optional flags ```bash

encrypt config file

./target/release/configcli -p config.toml -s "abcdefghijklmnopqrstuvwxyz123456" -n encryptconfig.toml -f toml encrypt

decrypt config file

./target/release/configcli -p encryptconfig.toml -s "abcdefghijklmnopqrstuvwxyz123456" -n encrypt_config.plain.toml -f toml decrypt ```

You can also pass the key through the environment variable AES_CONFIG_KEY. ```bash export AESCONFIGKEY=abcdefghijklmnopqrstuvwxyz123456

encrypt config file

./target/release/configcli -p config.toml -n encryptconfig.toml -f toml encrypt

decrypt config file

./target/release/configcli -p encryptconfig.toml -n encrypt_config.plain.toml -f toml decrypt ```

crate

```rust use aes_config::ConfigType; use serde::Deserialize; use std::fmt::Debug;

[derive(Deserialize, Debug)]

struct Config { port: u16, name: String, }

/* config.toml file: port=10086 name="test"

encrypt_config.toml file: qOOX56hXnadNC5uHU36IgB1i/2OKgfgXz4PmDYmy683qUewVqsg= */

fn main() { let salt = "abcdefghijklmnopqrstuvwxyz123456".tostring(); let c = aesconfig::ConfigInfo::new( "examples/encryptconfig.toml".tostring(), Some(salt), ConfigType::TOML, ) .unwrap(); println!("{:#?}", c.trygetconfig::().unwrap()); }

```