update config_util.rs

This commit is contained in:
2019-11-30 10:28:12 +08:00
parent da4e6397d2
commit 42c95fbb18
3 changed files with 53 additions and 30 deletions

View File

@@ -9,7 +9,8 @@ use std::{
use rust_util::{
XResult,
};
use pgp_util::OpenPGPTool;
use config_util::*;
// use pgp_util::OpenPGPTool;
// https://docs.sequoia-pgp.org/sequoia_openpgp/serialize/stream/struct.Encryptor.html
// https://gitlab.com/sequoia-pgp/sequoia/blob/master/openpgp/examples/generate-encrypt-decrypt.rs
@@ -18,9 +19,25 @@ fn main() -> XResult<()> {
println!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());
let openpgp_client = OpenPGPTool::from_file("sample.gpg")?;
// let openpgp_client = OpenPGPTool::from_file("sample.gpg")?;
openpgp_client.encrypt_file("a", "b.gpg", false)?;
// openpgp_client.encrypt_file("a", "b.gpg", false)?;
let config_json = get_config_json();
let j = config_json.unwrap();
println!("{}", j);
let c = parse_config(&j);
println!("{:?}", c);
println!("");
for i in c.items {
println!("{:?}", i);
}
Ok(())
}