use std::fmt; use web_push::{PartialVapidSignatureBuilder, VapidSignatureBuilder, WebPushError}; #[derive(Clone)] pub struct PrivateKey(String); impl PrivateKey { pub fn as_signature_builder(&self) -> Result { let Self(key) = self; VapidSignatureBuilder::from_base64_no_sub(key) } } impl fmt::Debug for PrivateKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("PrivateKey").field(&"********").finish() } } impl From for PrivateKey where S: Into, { fn from(value: S) -> Self { Self(value.into()) } }