feat: update base64 version

This commit is contained in:
2023-08-26 12:02:45 +08:00
parent 2ada122834
commit 1698e2d9f8
12 changed files with 47 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ use openpgp_card::OpenPgp;
use rust_util::util_clap::{Command, CommandError};
use rust_util::{util_msg, XResult};
use sha2::{Sha256, Sha384, Sha512};
use crate::util::base64_encode;
const BUFF_SIZE: usize = 512 * 1024;
@@ -89,7 +90,7 @@ impl Command for CommandImpl {
success!("User sign pin verify success!");
let sig = trans.signature_for_hash(Hash::SHA256(sha256_hex))?;
success!("SHA256 signature HEX: {}", hex::encode(&sig));
success!("SHA256 signature base64: {}", base64::encode(&sig));
success!("SHA256 signature base64: {}", base64_encode(&sig));
if json_output {
let mut entry = BTreeMap::new();
entry.insert("digest", hex::encode(&sha256_hex));
@@ -104,7 +105,7 @@ impl Command for CommandImpl {
success!("User sign pin verify success!");
let sig = trans.signature_for_hash(Hash::SHA384(sha384_hex))?;
success!("SHA384 signature HEX: {}", hex::encode(&sig));
success!("SHA384 signature base64: {}", base64::encode(&sig));
success!("SHA384 signature base64: {}", base64_encode(&sig));
if json_output {
let mut entry = BTreeMap::new();
entry.insert("digest", hex::encode(&sha384_hex));
@@ -119,7 +120,7 @@ impl Command for CommandImpl {
success!("User sign pin verify success!");
let sig = trans.signature_for_hash(Hash::SHA512(sha512_hex))?;
success!("SHA512 signature HEX: {}", hex::encode(&sig));
success!("SHA512 signature base64: {}", base64::encode(&sig));
success!("SHA512 signature base64: {}", base64_encode(&sig));
if json_output {
let mut entry = BTreeMap::new();
entry.insert("digest", hex::encode(&sha512_hex));