From a3d101a4055cf8bea39b143018d362628344b638 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 23 Dec 2023 15:25:05 +0800 Subject: [PATCH] feat: update wk --- src/wrap_key.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wrap_key.rs b/src/wrap_key.rs index 1b813f0..4f43144 100644 --- a/src/wrap_key.rs +++ b/src/wrap_key.rs @@ -42,11 +42,13 @@ impl WrapKey { buf.push_str(WRAP_KEY_PREFIX); let header = serde_json::to_string(&self.header)?; let header_str = util::encode_base64_url_no_pad(header.as_bytes()); + let nonce_str = util::encode_base64_url_no_pad(&self.nonce); + let encrypted_data_str = util::encode_base64_url_no_pad(&self.encrypted_data); buf.push_str(&header_str); buf.push('.'); - buf.push_str(&util::encode_base64_url_no_pad(&self.nonce)); + buf.push_str(&nonce_str); buf.push('.'); - buf.push_str(&util::encode_base64_url_no_pad(&self.encrypted_data)); + buf.push_str(&encrypted_data_str); Ok(buf) }