aboutsummaryrefslogtreecommitdiff
path: root/src/security/signed.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-23 07:51:48 +0100
committerMartin Fischer <martin@push-f.com>2021-12-23 23:05:10 +0100
commit460150079f7bbf868c42d0c3c10119a15e9d6b84 (patch)
treea7bea00b74670dad4ee663da7cbbb2a77d658496 /src/security/signed.rs
parent62fa053b4be22cdedfb4ffeb3045e9fc2d854292 (diff)
format with cargo fmt
Diffstat (limited to 'src/security/signed.rs')
-rw-r--r--src/security/signed.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/security/signed.rs b/src/security/signed.rs
index 4da6760..2954954 100644
--- a/src/security/signed.rs
+++ b/src/security/signed.rs
@@ -1,4 +1,4 @@
-use hmac::{Hmac,NewMac,Mac};
+use hmac::{Hmac, Mac, NewMac};
use sha2::Sha256;
const SIGNED_KEY_LEN: usize = 32;
@@ -9,11 +9,11 @@ const BASE64_DIGEST_LEN: usize = 44;
/// This code was adapted from the [`cookie`] crate which does not make the sign and verify functions public
/// forcing the use of [`CookieJar`](cookie::CookieJar)s, which are akward to work with without a high-level framework.
// Thanks to Sergio Benitez for writing the original code and releasing it under MIT!
-pub struct Key (pub [u8; SIGNED_KEY_LEN]);
+pub struct Key(pub [u8; SIGNED_KEY_LEN]);
impl Key {
const fn zero() -> Self {
- Key ( [0; SIGNED_KEY_LEN])
+ Key([0; SIGNED_KEY_LEN])
}
/// Attempts to generate signing/encryption keys from a secure, random
@@ -69,4 +69,4 @@ impl Key {
.map(|_| value.to_string())
.map_err(|_| "value did not verify".to_string())
}
-} \ No newline at end of file
+}