pub struct Key { /* private fields */ }
Expand description
a Key is a helper for creating or using a VAPID EC key.
Vapid Keys are always Prime256v1 EC keys.
Implementations§
Source§impl Key
impl Key
Sourcepub fn from_pem<P>(path: P) -> Result<Key, VapidError>
pub fn from_pem<P>(path: P) -> Result<Key, VapidError>
Read a VAPID private key in PEM format stored in path
Sourcepub fn to_pem(&self, path: &Path) -> Result<(), VapidError>
pub fn to_pem(&self, path: &Path) -> Result<(), VapidError>
Write the VAPID private key as a PEM to path
Sourcepub fn to_private_raw(&self) -> String
pub fn to_private_raw(&self) -> String
Convert the private key into a base64 string
Sourcepub fn to_public_raw(&self) -> String
pub fn to_public_raw(&self) -> String
Convert the public key into a uncompressed, raw base64 string
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more