feat: update base64 version
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use rust_util::{util_msg, XResult};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use rust_util::util_msg::MessageType;
|
||||
use rust_util::{util_msg, XResult};
|
||||
use yubikey::piv::{AlgorithmId, SlotId};
|
||||
use yubikey::{piv, YubiKey};
|
||||
use yubikey::piv::{AlgorithmId, SlotId};
|
||||
|
||||
use crate::util::base64_encode;
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
@@ -61,11 +63,11 @@ impl Command for CommandImpl {
|
||||
let mut json = BTreeMap::<&'_ str, String>::new();
|
||||
json.insert("hash_hex", hex::encode(&hash));
|
||||
json.insert("sign_hex", hex::encode(&sign_bytes));
|
||||
json.insert("sign_base64", base64::encode(&sign_bytes));
|
||||
json.insert("sign_base64", base64_encode(&sign_bytes));
|
||||
println!("{}", serde_json::to_string_pretty(&json).unwrap());
|
||||
} else {
|
||||
success!("Signature HEX: {}", hex::encode(sign_bytes));
|
||||
success!("Signature base64: {}", base64::encode(sign_bytes));
|
||||
success!("Signature base64: {}", base64_encode(sign_bytes));
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user